1
我試圖配置我的SSH配置以實現更簡單的工作流程,但是我已經在此處運行。 我有一個跳轉主機,需要sudo ssh
才能連接所有其他機器。無法使用代理服務器上的sudo獲得SSH ProxyCommand的工作
我已經想通了,如果我跑ssh -tt jumphost sudo ssh desthost
,我從哪裏得到我的sudo
密碼,我可以訪問desthost
現在,當我添加ProxyCommand ssh -tt jumphost sudo ssh %h
我ssh_config
和運行ssh desthost
然後我就得到了一個空白連接。
調試打印輸出:
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1: Reading configuration data /Users/deiga/.ssh/config
debug1: /Users/deiga/.ssh/config line 34: Applying options for desthost
debug1: /Users/deiga/.ssh/config line 167: Applying options for *
debug1: Reading configuration data /etc/ssh_config
debug1: /etc/ssh_config line 20: Applying options for *
debug1: auto-mux: Trying existing master
debug1: Control socket "/tmp/[email protected]:22" does not exist
debug2: ssh_connect: needpriv 0
debug1: Executing proxy command: exec ssh -tt jumphost sudo ssh desthost
debug1: identity file /Users/deiga/.ssh/id_rsa type -1
debug1: identity file /Users/deiga/.ssh/id_rsa-cert type -1
debug1: identity file /Users/deiga/.ssh/id_dsa type -1
debug1: identity file /Users/deiga/.ssh/id_dsa-cert type -1
debug1: permanently_drop_suid: 501
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.2
debug1: ssh_exchange_identification: [sudo] password for deiga:
debug1: ssh_exchange_identification: Sorry, try again.
debug1: ssh_exchange_identification: [sudo] password for deiga:
debug1: ssh_exchange_identification: sudo: 1 incorrect password attempt
我試過所有這些。但是jumphost需要一個tty來sudo,它需要sudo來連接到desthost。所以,如果我做'ProxyCommand ssh -tt jumphost sudo nc%h%p'我的ssh連接只是掛起而不要求輸入密碼或任何東西 – deiga