Estou tentando estabelecer o encaminhamento de porta local, mas me deparei com duas dificuldades:
Ao usar o ssh -vL 1083:127.0.0.1:22 akveton2@cms904usr -N
comando, eu recebo este erro:
bind: Cannot assign requested address
Eu pesquisei um pouco e descobri que, se esta linha estiver incluída na saída de depuração, ela está tentando se conectar usando IPv6:
debug1: Local forwarding listening on ::1 port 1083.
Desde então, adicionei o argumento -4 ao comando, portanto, o erro de ligação não está sendo impresso mais, mas agora a conexão é interrompida após inserir a senha. Qual poderia ser o problema? Aqui está o log:
[akveton@lxplus070 ~]$ ssh -vL 1083:127.0.0.1:1083 akveton2@cms904usr -N
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to cms904usr [137.138.251.206] port 22.
debug1: Connection established.
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/identity type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/identity-cert type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_rsa type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_rsa-cert type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_dsa type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_dsa-cert type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_ecdsa type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'cms904usr' is known and matches the RSA host key.
debug1: Found key in /afs/cern.ch/user/a/akveton/.ssh/known_hosts:13
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
Server not found in Kerberos database
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: password
akveton2@cms904usr's password:
debug1: Authentication succeeded (password).
debug1: Local connections to LOCALHOST:1083 forwarded to remote address 127.0.0.1:1083
debug1: Local forwarding listening on 127.0.0.1 port 1083.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on ::1 port 1083.
bind: Cannot assign requested address
debug1: Requesting [email protected]
debug1: Entering interactive session.
^Cdebug1: channel 0: free: port listener, nchannels 1
Killed by signal 2.
[akveton@lxplus070 ~]$ ssh -v4L 1083:127.0.0.1:22 akveton2@cms904usr -N^C
[akveton@lxplus070 ~]$ ssh -v4L 1083:127.0.0.1:1083 akveton2@cms904usr -N
OpenSSH_5.3p1, OpenSSL 1.0.1e-fips 11 Feb 2013
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to cms904usr [137.138.251.206] port 22.
debug1: Connection established.
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/identity type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/identity-cert type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_rsa type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_rsa-cert type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_dsa type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_dsa-cert type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_ecdsa type -1
debug1: identity file /afs/cern.ch/user/a/akveton/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 1.99, remote software version OpenSSH_5.3
debug1: match: OpenSSH_5.3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.3
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-ctr hmac-sha1 none
debug1: kex: client->server aes128-ctr hmac-sha1 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<2048<8192) sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_GROUP
debug1: SSH2_MSG_KEX_DH_GEX_INIT sent
debug1: expecting SSH2_MSG_KEX_DH_GEX_REPLY
debug1: Host 'cms904usr' is known and matches the RSA host key.
debug1: Found key in /afs/cern.ch/user/a/akveton/.ssh/known_hosts:13
debug1: ssh_rsa_verify: signature correct
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: SSH2_MSG_SERVICE_REQUEST sent
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: gssapi-keyex
debug1: No valid Key exchange context
debug1: Next authentication method: gssapi-with-mic
debug1: Unspecified GSS failure. Minor code may provide more information
Server not found in Kerberos database
debug1: Authentications that can continue: gssapi-keyex,gssapi-with-mic,password
debug1: Next authentication method: password
akveton2@cms904usr's password:
debug1: Authentication succeeded (password).
debug1: Local connections to LOCALHOST:1083 forwarded to remote address 127.0.0.1:1083
debug1: Local forwarding listening on 127.0.0.1 port 1083.
debug1: channel 0: new [port listener]
debug1: Requesting [email protected]
debug1: Entering interactive session.
Mais alguns sintomas:
Se eu abrir dois terminais, um onde realizo o túnel e outro com o curl:
Eu digito curl --socks5 localhost:1083 http://cms904usr
no segundo terminal e recebo:
curl: (7) Failed to receive SOCKS5 connect request ack.
Ao mesmo tempo, o primeiro terminal imprime
channel 1: open failed: connect failed: Connection refused
Se eu digitar curl --proxy localhost:1083 http://cms904usr
no segundo terminal, obtenho
curl: (52) Empty reply from server
e nada no primeiro terminal.
Se eu tentar conectar usando o firefox, recebo
The proxy server is refusing connections