Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I can't seem to ssh from my ubuntu EC2 server into my work linux box. From my work linux box, I can ssh into myself via ssh -p <my listening ssh port> <user>@<my ip>

The same command does not work from my EC2 server. With verbose option I see this message:

Applying options for *
ssh_connect: needpriv 0
Connecting to <work ip> port< my ssh port>

On my work linux machine, I check for open port with netstat -a

Proto | Recv-Q | Send-Q | Local Address | Foreign Address | State       
tcp | 0 | 0 *:<my ssh port> | *:* | LISTEN    

and all seems to be well. I have tried changing my work ssh port in /etc/ssh/sshd_config to no avail. Is there something with EC2 that requires additional manipulation?

share|improve this question

migrated from serverfault.com Feb 10 '13 at 19:59

This question came from our site for system and network administrators.

    
Is your home Linux box connected directly to the internet, or is it behind a router or something? Does your ISP permit inbound traffic on port 22? –  ceejayoz Feb 10 '13 at 18:18
1  
You won't be able to SSH into a computer behind the router unless the router is specifically set up to pass SSH traffic to the server. –  ceejayoz Feb 10 '13 at 18:35
    
I can ssh into my ec2 server from behind my router. Just to clarify, you're saying my router has to be explicitly configured to accept inbound ssh? –  Tom St. Laurent Feb 10 '13 at 18:38
    
Yes, that's correct. Computers behind a NAT can initiate outgoing traffic, but they can't receive unsolicited incoming traffic unless the device doing the NATting is set up to pass that traffic on. See en.wikipedia.org/wiki/… and en.wikipedia.org/wiki/Network_address_translation#Drawbacks –  ceejayoz Feb 10 '13 at 18:49
    
Ah okay, I see. Thanks a lot! –  Tom St. Laurent Feb 10 '13 at 19:04

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.