Sono dietro un proxy HTTP e sto provando a connettermi a una macchina remota dalla mia nota Ubuntu tramite ssh. Se configuro il mio .ssh / config come
Host test
HostName 55.66.77.88
ProxyCommand nc -X connect -x proxy.corp.com:8080 %h %p
User test_user
Posso collegarmi al computer remoto. Ci sono altri utenti sulla mia rete (usando OSX) che possono connettersi alla stessa macchina aggiungendo l'IP della macchina alla no_proxy
variabile, senza il nc su ssh / config. Se aggiungo la macchina sulla mia no_proxy
variabile su zshenv
:
no_proxy="localhost,127.0.0.1,55.66.77.88"
NO_PROXY=$no_proxy
e controlla il mio terminale, la variabile è impostata (dopo l'esportazione):
no_proxy=localhost,127.0.0.1,55.66.77.88
ma ora non riesco a collegarmi alla macchina. Cosa può andare storto? Credo che la no_proxy
variabile venga ignorata, ma non posso provarla.
MODIFICA Aggiunta di una sessione ssh senza la riga nc nel file di configurazione:
ssh 55.66.77.88 -v
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/user/.ssh/config
debug1: /home/user/.ssh/config line 1: Applying options for *
debug1: /home/user/.ssh/config line 16: Applying options for 55.66.77.88
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 55.66.77.88 [55.66.77.88] port 22.
e con nc
il config
file:
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /home/user/.ssh/config
debug1: /home/user/.ssh/config line 1: Applying options for *
debug1: /home/user/.ssh/config line 16: Applying options for 55.66.77.88
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Executing proxy command: exec nc -X connect -x proxy.corporation.br:8080 55.66.77.88 22
debug1: permanently_drop_suid: 1000
debug1: identity file /home/user/.ssh/id_rsa type 1
debug1: identity file /home/user/.ssh/id_rsa-cert type -1
debug1: identity file /home/user/.ssh/id_dsa type -1
debug1: identity file /home/user/.ssh/id_dsa-cert type -1
debug1: identity file /home/user/.ssh/id_ecdsa type -1
debug1: identity file /home/user/.ssh/id_ecdsa-cert type -1
debug1: identity file /home/user/.ssh/id_ed25519 type -1
debug1: identity file /home/user/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1p1 Ubuntu-2ubuntu2.3
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4+deb7u2
debug1: match: OpenSSH_6.0p1 Debian-4+deb7u2 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-md5 none
debug1: kex: client->server aes128-ctr hmac-md5 none
debug1: sending SSH2_MSG_KEX_ECDH_INIT
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Host '[55.66.77.88]:22' is known and matches the ECDSA host key.
debug1: Found key in /home/user/.ssh/known_hosts:7
debug1: ssh_ecdsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: Roaming not allowed by server
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/user/.ssh/id_rsa
debug1: Authentications that can continue: publickey,password
debug1: Trying private key: /home/user/.ssh/id_dsa
debug1: Trying private key: /home/user/.ssh/id_ecdsa
debug1: Trying private key: /home/user/.ssh/id_ed25519
debug1: Next authentication method: password
user@55.66.77.88's password:
debug1: Authentication succeeded (password).
Authenticated to 55.66.77.88 (via proxy).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LC_PAPER = pt_BR.UTF-8
debug1: Sending env LC_MONETARY = pt_BR.UTF-8
debug1: Sending env LC_TELEPHONE = pt_BR.UTF-8
debug1: Sending env LC_NAME = pt_BR.UTF-8
debug1: Sending env LANG = pt_BR.UTF-8
debug1: Sending env LC_NUMERIC = pt_BR.UTF-8
debug1: Sending env LC_MEASUREMENT = pt_BR.UTF-8
debug1: Sending env LC_TIME = pt_BR.UTF-8
debug1: Sending env LC_IDENTIFICATION = pt_BR.UTF-8
debug1: Sending env LC_ADDRESS = pt_BR.UTF-
Grazie