diff --git a/wavesrv/pkg/remote/remote.go b/wavesrv/pkg/remote/remote.go index f374df51..0471222b 100644 --- a/wavesrv/pkg/remote/remote.go +++ b/wavesrv/pkg/remote/remote.go @@ -1733,6 +1733,7 @@ func (msh *MShellProc) Launch(interactive bool) { msh.ServerProc = cproc msh.Status = StatusConnected }) + msh.WriteToPtyBuffer("connected to %s\n", remoteCopy.RemoteCanonicalName) go func() { exitErr := cproc.Cmd.Wait() exitCode := shexec.GetExitCode(exitErr) diff --git a/wavesrv/pkg/remote/sshclient.go b/wavesrv/pkg/remote/sshclient.go index 9fc7a010..8da49ed5 100644 --- a/wavesrv/pkg/remote/sshclient.go +++ b/wavesrv/pkg/remote/sshclient.go @@ -390,7 +390,7 @@ func createHostKeyCallback(opts *sstore.SSHOpts) (ssh.HostKeyCallback, error) { // incorrectly. if a problem file is found, it is removed from our list // and we try again var basicCallback ssh.HostKeyCallback - for len(knownHostsFiles) > 0 { + for basicCallback == nil && len(knownHostsFiles) > 0 { var err error basicCallback, err = knownhosts.New(knownHostsFiles...) if serr, ok := err.(*os.PathError); ok { @@ -412,10 +412,6 @@ func createHostKeyCallback(opts *sstore.SSHOpts) (ssh.HostKeyCallback, error) { } } - if basicCallback == nil { - basicCallback = func(hostname string, remote net.Addr, key ssh.PublicKey) error { return &knownhosts.KeyError{} } - } - waveHostKeyCallback := func(hostname string, remote net.Addr, key ssh.PublicKey) error { err := basicCallback(hostname, remote, key) if err == nil {