Results 1 to 6 of 6
I've been having some grief with ssh. If I leave it set to run with defaults - i.e. at port 22 I have no issues. I am running behind a ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 09-26-2005 #1Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
SSH Port Configuration - Setting Higher Port Numbers
I've been having some grief with ssh. If I leave it set to run with defaults - i.e. at port 22 I have no issues. I am running behind a zyxel adsl modem/router and have NAT set to keep 22 open, and ssh set as an available service in the suse firewall. I have wanted to get ssh running on a different port with the hope that perhaps attempts at logins by script kiddies will be minimised. However when I set /etc/ssh/ssh_config to run at port 57921, set NAT on my router to forward this port and restart the sshd daemon I get the error "SSH: Connection refused on Port 57921".
Am I missing something obvious here? I'd feel much better if I could get this running on a higher, less obvious port number. Any documentation I can find on ports seems to be relating to portforwarding and not reconfiguring existing ports. Any help appreciated.
- 09-26-2005 #2
Did you tell the SuSE firewall to open the new port too? Normally, if you tell your firewall config to open the SSH port, it opens port 22, it doesn't monitor connection types to see what kind of service they are - i.e. it cannot open up access for data streams that carry SSH connections on any port.
Linux user #126863 - see http://linuxcounter.net/
- 09-26-2005 #3Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
I opened the port seperately in the firewall configuration. That's kind of what's bothering me, because if it was NAT I would guess that I would get no response from ssh. It seems odd that I'm getting connection refused. Do you know where security settings for ssh are - ssh_config seemed a little sparse.
- 09-26-2005 #4
dohh!
Silly me, you're running and ssh server, and you're editing /etc/ssh/ssh_config to control it. I think you need to edit /etc/ssh/sshd_config and change settings in there for the server (dont forget to restart the ssh service).
Change the 'Port' line at the top of the file, and if you browse down the file, you'll find all sorts of things with which you can adjust the security, including the ever popular 'PermitRootLogin' which should be set to 'no'. To read the man page, use 'man sshd_config'Linux user #126863 - see http://linuxcounter.net/
- 09-26-2005 #5Correct - ssh_config is for client.I think you need to edit /etc/ssh/sshd_config and change settings in there for the server (dont forget to restart the ssh service).
- 09-26-2005 #6Linux Guru
- Join Date
- Nov 2004
- Posts
- 6,110
Thanks guys, appreciate it

I'll be straight on that when I get home.


Reply With Quote
