0
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?
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 – 2013-02-10T18:18:13.447
1You 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 – 2013-02-10T18:35:40.350
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? – None – 2013-02-10T18:38:07.807
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 http://en.wikipedia.org/wiki/Network_address_translation#Establishing_Two-Way_Communication and http://en.wikipedia.org/wiki/Network_address_translation#Drawbacks
– ceejayoz – 2013-02-10T18:49:40.717