Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSH to remote server

Status
Not open for further replies.

jaredgalen

Programmer
May 28, 2003
34
LT
I need to ssh into a remote machine.
the problem is that I am behind a proxy that blocks port 22.
I have been looking at port forwarding but I can't quite get my head around it.

Do I need to make the remote machine listen on a different port so that I can connect or something? Or is their some jiggery pokery I can do here behind the proxy to connect to the remote machines on port 22?
 
Its a good idea anyway to run ssh on some port other than 22 since so many scriptkiddies will try and attack that common port.
 
find out what port you can get out on

let's assume you will use 8181

On the remote machine run the following



iptables -t nat -A PREROUTING -i your_input_interface -p tcp --dport 8181 -j REDIRECT --to-port 22

On the client machine

ssh -p 8181 remotehost.domain.com


Otherwise edit sshd.conf file to permanently change SSH port.

What mrregan is telling you is true; if yo leave a public server with port 22 open you will find several huundred login attempts in the morning in your logwatch message.

Cheers

QatQat

Life is what happens when you are making other plans.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top