Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Remote SSH forwarding won't work
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
djco
Retired Dev
Retired Dev


Joined: 29 Mar 2003
Posts: 67
Location: 52.36, 4.89

PostPosted: Mon Oct 15, 2007 7:26 am    Post subject: Remote SSH forwarding won't work Reply with quote

I want to be able to login to a NATted box at work from home, so I wanted to do remote SSH forwarding, like this:

ssh -N -R 2222:localhost:22 example.com

But when I login to example.com and try to login to the work box, it won't work:

djc@enrai ~ $ ssh -vvv 127.0.0.1:2222
OpenSSH_4.7p1, OpenSSL 0.9.8e 23 Feb 2007
debug1: Reading configuration data /etc/ssh/ssh_config
debug2: ssh_connect: needpriv 0
ssh: 127.0.0.1:2222: Name or service not known

djc@enrai ~ $ netstat -a
tcp 0 0 enrai.xavamedia.nl:2222 *:* LISTEN

So why isn't this working?
Back to top
View user's profile Send private message
merlijn
Apprentice
Apprentice


Joined: 10 Apr 2007
Posts: 161
Location: Den Haag, Holland

PostPosted: Mon Oct 15, 2007 9:57 am    Post subject: Reply with quote

This should work just fine if you have port 2222 forwarded to this box after the NAT.

However what I think is going wrong now, port 2222 is listening on the eth0 interface (enrai.xavamedia.nl), so you can't address that by using 127.0.0.1, you can see if it works by connecting to the lan ip of this box.

Hope this helps,
_________________
Gigabyte G33-DS3R, E6850, 4gb ddr2-800, 8800GT, Acer AL2623W - amd64
MacBookPro 2.4ghz, 2gb ddr2-667 - ~x86

Code:
ROOT="/mnt/coffeecup/" USE="sugar extra-sugar milk" emerge --update --deep --verbose --oneshot coffee
Back to top
View user's profile Send private message
JeliJami
Veteran
Veteran


Joined: 17 Jan 2006
Posts: 1086
Location: Belgium

PostPosted: Mon Oct 15, 2007 11:30 am    Post subject: Re: Remote SSH forwarding won't work Reply with quote

Manuzhai wrote:
...
ssh: 127.0.0.1:2222: Name or service not known


to connect on a different port, use -p <port>:
Code:
ssh -p 2222 127.0.0.1

_________________
Unanswered Post Initiative | Search | FAQ
Former username: davjel
Back to top
View user's profile Send private message
djco
Retired Dev
Retired Dev


Joined: 29 Mar 2003
Posts: 67
Location: 52.36, 4.89

PostPosted: Fri Oct 19, 2007 7:02 am    Post subject: Re: Remote SSH forwarding won't work Reply with quote

davjel wrote:
Manuzhai wrote:
...
ssh: 127.0.0.1:2222: Name or service not known


to connect on a different port, use -p <port>:
Code:
ssh -p 2222 127.0.0.1
I guess that was it. Blegh, sorry for the noise.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum