Don't force port 22 if the port is not set.

In this way ~/.ssh/config can take effect
This commit is contained in:
Kohsuke Kawaguchi 2013-09-27 09:48:12 -07:00
parent eb20ba42aa
commit 14ff83390e
1 changed files with 6 additions and 4 deletions

View File

@ -198,10 +198,12 @@ module Blimpy
end
def ssh_commands(*args)
['ssh', '-o', 'PasswordAuthentication=no',
'-o', 'StrictHostKeyChecking=no',
'-p', (ssh_port||22).to_s,
'-l', username, dns, *args]
cmds = ['ssh', '-o', 'PasswordAuthentication=no',
'-o', 'StrictHostKeyChecking=no' ]
if (ssh_port)
cmds += [-p, ssh_port.to_s]
end
cmds += ['-l', username, dns, *args]
end
def ssh_into(*args)