ssh port forwarding problem

2

Eu quero usar o encaminhamento de porta ssh. Eu não usei esse recurso por alguns anos, então eu posso ter esquecido algo óbvio, ou os padrões do SO podem ter mudado.

Eu tentei isso em três máquinas diferentes (todo o Ubuntu 9.10). A depuração diz que está abrindo as portas para ouvir. Eles devem ir embora imediatamente e em silêncio.

Eu verifiquei que posso acessar 192.168.1.8:80 da minha máquina local.

Há provavelmente um motivo muito simples, mas não o encontrei em 20 minutos de googling.

Alguma ideia do problema?

Obrigado,

Chris.

root@chris-desktop:~# ssh -v -L 3142:192.168.1.8:80 yellow.example.com
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g 19 Oct 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Applying options for *
debug1: Connecting to yellow.example.com [199.82.114.103] port 22.
debug1: Connection established.
debug1: permanently_set_uid: 0/0
debug1: identity file /root/.ssh/identity type -1
debug1: identity file /root/.ssh/id_rsa type 1
debug1: Checking blacklist file /usr/share/ssh/blacklist.RSA-2048
debug1: Checking blacklist file /etc/ssh/blacklist.RSA-2048
debug1: identity file /root/.ssh/id_dsa type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.1p1 Debian-6ubuntu2
debug1: match: OpenSSH_5.1p1 Debian-6ubuntu2 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.1p1 Debian-6ubuntu2
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: server->client aes128-cbc hmac-md5 none
debug1: kex: client->server aes128-cbc hmac-md5 none
debug1: SSH2_MSG_KEX_DH_GEX_REQUEST(1024<1024<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 'yellow.example.com' is known and matches the RSA host key.
debug1: Found key in /root/.ssh/known_hosts:9
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: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /root/.ssh/identity
debug1: Offering public key: /root/.ssh/id_rsa
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug1: read PEM private key done: type RSA
debug1: Authentication succeeded (publickey).
debug1: Local connections to LOCALHOST:3142 forwarded to remote address 192.168.1.8:80
debug1: Local forwarding listening on ::1 port 3142.
debug1: channel 0: new [port listener]
debug1: Local forwarding listening on 127.0.0.1 port 3142.
debug1: channel 1: new [port listener]
debug1: channel 2: new [client-session]
debug1: Requesting [email protected]
debug1: Entering interactive session.
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
Linux yellow 2.6.31-17-server #54-Ubuntu SMP Thu Dec 10 18:06:56 UTC 2009 x86_64

To access official Ubuntu documentation, please visit:
http://help.ubuntu.com/

  System information as of Thu Feb 18 09:31:36 GMT 2010

  System load: 0.0                Memory usage: 51%   Processes:       96
  Usage of /:  1.3% of 194.04GB   Swap usage:   0%    Users logged in: 0

  Graph this data and manage this system at https://landscape.canonical.com/

18 packages can be updated.
13 updates are security updates.

Last login: Thu Feb 18 09:26:14 2010 from gate.example.com

root@yellow:~# ~#
The following connections are open:
  #2 client-session (t4 r0 i0/0 o0/0 fd 6/7 cfd -1)

root@yellow:~# netstat -lntp | grep 3142
root@yellow:~#
    
por fadedbee 18.02.2010 / 10:49

2 respostas

5

Não sigo bem o que você está tentando alcançar. Talvez você esteja confundindo a opção -L com a opção -R ?

    
por 18.02.2010 / 11:52
4

Você está encaminhando

chris-desktop:3142 to 192.168.1.8:80 via the sshd process on yellow.example.com

A saída de

root@yellow:~# netstat -lntp | grep 3142
root@yellow:~#

é como esperado. Não há nada escutando em yellow:3142 porque a conexão com 192.168.1.8:80 está sendo gerenciada pelo processo sshd em yellow .

Você deve ver um processo de escuta quando executa

root@chris-desktop:~# netstat -lntp | grep 3142
    
por 18.02.2010 / 11:56