lib/ztk/ssh.rb in ztk-1.0.8 vs lib/ztk/ssh.rb in ztk-1.0.9

- old
+ new

@@ -179,10 +179,11 @@ # ssh.console def console config.ui.logger.debug { "config=#{config.send(:table).inspect}" } config.ui.logger.info { "console(#{console_command.inspect})" } + config.ui.logger.fatal { "REPLACING CURRENT PROCESS - GOODBYE!" } Kernel.exec(console_command) end # Executes a command on the remote host. # @@ -387,42 +388,48 @@ private # Builds our SSH console command. def console_command - command = [ "ssh" ] + command = [ "/usr/bin/env ssh" ] command << [ "-q" ] - command << [ "-A" ] + command << [ "-4" ] + command << [ "-x" ] + command << [ "-a" ] command << [ "-o", "UserKnownHostsFile=/dev/null" ] command << [ "-o", "StrictHostKeyChecking=no" ] command << [ "-o", "KeepAlive=yes" ] command << [ "-o", "ServerAliveInterval=60" ] + command << [ "-o", %(ProxyCommand="#{proxy_command}") ] if config.proxy_host_name command << [ "-i", config.keys ] if config.keys command << [ "-p", config.port ] if config.port - command << [ "-o", %(ProxyCommand="#{proxy_command}") ] if config.proxy_host_name + # command << [ "-vv" ] command << "#{config.user}@#{config.host_name}" - command = command.flatten.compact.join(" ") + command = command.flatten.compact.join(' ') config.ui.logger.debug { "console_command(#{command.inspect})" } command end # Builds our SSH proxy command. def proxy_command !config.proxy_user and log_and_raise(SSHError, "You must specify an proxy user in order to SSH proxy.") !config.proxy_host_name and log_and_raise(SSHError, "You must specify an proxy host_name in order to SSH proxy.") - command = ["ssh"] + command = ["/usr/bin/env ssh"] command << [ "-q" ] - command << [ "-A" ] + command << [ "-4" ] + command << [ "-x" ] + command << [ "-a" ] command << [ "-o", "UserKnownHostsFile=/dev/null" ] command << [ "-o", "StrictHostKeyChecking=no" ] command << [ "-o", "KeepAlive=yes" ] command << [ "-o", "ServerAliveInterval=60" ] command << [ "-i", config.proxy_keys ] if config.proxy_keys command << [ "-p", config.proxy_port ] if config.proxy_port + # command << [ "-vv" ] command << "#{config.proxy_user}@#{config.proxy_host_name}" - command << "nc %h %p" - command = command.flatten.compact.join(" ") + command << "'/usr/bin/env nc %h %p'" + command = command.flatten.compact.join(' ') config.ui.logger.debug { "proxy_command(#{command.inspect})" } command end # Builds our SSH options hash.