SSH behind proxy


What is the best way to SSH to my sever behind company proxy , it seems that 22 port is not opened by default , is there any simple way to do that rather than to install corkscrew ??

When I do :

✗ ssh -i ~/.ec2/mykey.pem ubuntu@XX.XX.XXX.XXX
ssh: connect to host XX.XX.XXX.XXX port 22: Operation timed out  

Best Answer

The simple way is to modify /etc/ssh/sshd.conf on the server (XX.XX.XXX.XXX) to listen on some port you can access through the proxy. For example port 80 is not usually blocked. Port 443 is another good candidate. If you don't have root access to the server, you might persuade whoever has to do it for you. sshd must be restarted after changing the file for the effect to take place.

A different, simple, approach is to ask whoever administers the proxy to let you connect through it on port 22.

Related Question