diff options
Diffstat (limited to 'rsh/main.go')
| -rw-r--r-- | rsh/main.go | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/rsh/main.go b/rsh/main.go index 9906966..d75a9c7 100644 --- a/rsh/main.go +++ b/rsh/main.go @@ -138,7 +138,7 @@ func transport(args []string, in io.Reader, out, errw io.Writer) error { // an unknown or changed key still fails loud, just after the dial. algos = scanAlgos } - client, err := dial(user, host, cb, algos) + client, err := dial(user, host, port, cb, algos) if err != nil { return err } @@ -189,7 +189,7 @@ func scan(target string, out io.Writer) error { hostKey = key return nil } - client, err := dial(user, host, capture, algos) + client, err := dial(user, host, port, capture, algos) if err != nil { return err } @@ -314,15 +314,11 @@ func loadSigner() (ssh.Signer, error) { // dial opens an SSH connection authenticated with the configured key, verifying // the host key with hostKey and offering only the host-key algorithms in algos. -func dial(user, host string, hostKey ssh.HostKeyCallback, algos []string) (*ssh.Client, error) { +func dial(user, host string, port int, hostKey ssh.HostKeyCallback, algos []string) (*ssh.Client, error) { signer, err := loadSigner() if err != nil { return nil, err } - port, err := sshPort() - if err != nil { - return nil, err - } timeout, err := dialTimeout() if err != nil { return nil, err |