I want to use ssh port forwarding. I haven't used this feature for a few years, so I may have forgotten something obvious, or OS defaults may have changed.
I have tried this on three different machines (all Ubuntu 9.10). The debug says that it is opening the ports for listening. They must be going away immediately and silently.
I've checked that I can reach 192.168.1.8:80 from my local machine.
There's probably a very simple reason, but I've not found it in 20 minutes of googling.
Any idea what the problem could be?
Thanks,
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:~#
I don't quite follow what you're trying to achieve. Maybe you're confusing the
-L
switch with the-R
switch?You are forwarding
The output from
is as expected. There is nothing listening on
yellow:3142
because the connection to192.168.1.8:80
is being managed by the sshd process onyellow
.You should see a listening process when you execute