Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 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
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… and – ceejayoz Feb 10 '13 at 18:49
Ah okay, I see. Thanks a lot! – Tom St. Laurent Feb 10 '13 at 19:04

You must log in to answer this question.

Browse other questions tagged .