Why is it that I can ssh in but not out?

2

Why is it that I can ssh into another server but when I tried to ssh but it goes into timeout and failed?

ubi@xserver: ssh lil@yserver
Password: 
Last login: Thu Jan 30 16:10:39 2014 from xserver
lil@yserver:~> ssh ubi@xserver
_

I've tried ssh with option -A but it's not working:

lil@yserver:~ # ssh -A ubi@xserver
^C

The ssh daemon is running:

lil@yserver:~ # rcsshd reload
Reload service sshd                                                                                                                 
done
lil@yserver:~ # rcsshd restart
Shutting down the listening SSH daemon                                                                                                  
done
Starting SSH daemon                                                                                                                 
done
lil@yserver:~ # ssh ubi@xserver
^C

alvas

Posted 2014-01-30T15:20:36.750

Reputation: 95

What have you tried? Did you try finding in man ssh that there exists a verbose mode? – 174140 – 2014-01-30T15:22:07.337

1Are you sure xserver is running sshd? – None – 2014-01-30T15:25:39.850

I agree with Slowki - could be that sshd isnt running on xserver or xserver has a firewall running that's blocking port the ssh port (usually 22) – FreudianSlip – 2014-01-30T15:38:48.470

On xserver run ps ax | grep ssh and iptables -L and you can answer both of FreudianSlip's questions :) – NickW – 2014-01-30T16:15:15.913

1Try running ssh with -vvv to show where it's sticking. – Nathan C – 2014-01-30T16:22:01.873

Answers

5

As others explained, you need an SSH server running on xserver for this to work.

If you're able to ssh ubi@xserver from other hosts but not as lil@yserver, it could be any number of things, including but not limited to these common causes:

  • xserver resolves to a different IP address on yserver - try ping xserver on yserver and on the host which can reach xserver.
  • xserver could have firewall rules set up to allow connections from a whitelist which does not include yserver.

l0b0

Posted 2014-01-30T15:20:36.750

Reputation: 6 306