Advertisement

Which port to route for SSH?

Started by March 03, 2005 07:30 AM
11 comments, last by bytecoder 19 years, 9 months ago
My linux box is behind a wireless router and I'd like to be able to use SSH (putty specifically) to connect to it, so I have to configure the router to route the port traffic to that specific machine. Does anybody know which port(s) it is? Or perhaps a way to experiment and find out? I've never attempted to monitor port traffic before, but I imagine I could just look for the IP of the computer attempting the connection.
Without order nothing can exist - without chaos nothing can evolve.
SSH by default is on port 22, if I'm not mistaken.
"THE INFORMATION CONTAINED IN THIS REPORT IS CLASSIFIED; DO NOT GO TO FOX NEWS TO READ OR OBTAIN A COPY." , the pentagon
Advertisement
22, eh? Would it be a bad idea to route all traffic to that port to one computer? It seems like something like 22 might be used for more. Do you know if it is?

EDIT:
Oh wow, I didn't even notice this. Putty lets you specify a port. Can I just choose one, arbitrarily, and route that traffic? That sounds reckless to me. Maybe there's a listing of generally free ports somewhere? Or perhaps my router logs port traffic and I can just see which ones don't get any traffic? This stuff is so cool.
Without order nothing can exist - without chaos nothing can evolve.
PuTTY can't change the port your server listens on. 22 is SHH only by the way, nothing else.
Quote: Original post by Anonymous Poster
PuTTY can't change the port your server listens on.


So I can't just change that number to something random and then forward that traffic to the appropriate computer when it hits the router?
Without order nothing can exist - without chaos nothing can evolve.
Quote: Original post by CyberSlag5k
So I can't just change that number to something random and then forward that traffic to the appropriate computer when it hits the router?


Well technically you can. If I understand you correctly, you want to forward a port on the router to another port on a computer on your network, that should work, provided that your router allows you to do it. It is actually good to have SSH on a nonstandard port if it's wide open to the internet. Prevents those pesky automated ssh scans... Hint: Make sure all users who are not supposed to have shell access have their default shell set to /sbin/nologin. You'll thank me later.
Advertisement
One more thing... DO NOT use passwords that are present in a dictionary as passwords for ssh accounts accessible from the internet. Not even with some numbers like 123 attached to them. You'll thank me later for that too.
Don't even use passwords; set up public/private keys.
Ra
Quote: Original post by Ra
Don't even use passwords; set up public/private keys.


Do tell.
Without order nothing can exist - without chaos nothing can evolve.
The disadvantage of using key pairs is that you have to carry the private key with you on a floppy or usb key, though.

This topic is closed to new replies.

Advertisement