From 14ff83390e9afba86f0f99d9e0acea90bc014d63 Mon Sep 17 00:00:00 2001 From: Kohsuke Kawaguchi Date: Fri, 27 Sep 2013 09:48:12 -0700 Subject: [PATCH] Don't force port 22 if the port is not set. In this way ~/.ssh/config can take effect --- lib/blimpy/box.rb | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/blimpy/box.rb b/lib/blimpy/box.rb index 4214fec..7a53c6c 100644 --- a/lib/blimpy/box.rb +++ b/lib/blimpy/box.rb @@ -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)