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 [email protected]
ssh: connect to host XX.XX.XXX.XXX port 22: Operation timed out
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.
I wasn't aware of corkscrew, but that seems like your best bet, if you can issue CONNECT requests through an HTTP proxy. Either that, or use the ProxyCommand
directive with some other command that can make the connection for you.
You really should be talking to your network administrator about your need to use SSH though.