Linux problem: can't change port in sshd_config file
-
Topic author - Site Admin
- Posts in topic: 3
- Posts: 17787
- Joined: Wed Dec 22, 2004 9:31 pm
- Location: Friendswood, TX
- Contact:
Linux problem: can't change port in sshd_config file
What I don't know about Linux would fill volumes!!! I have to use it for a ham radio repeater linking project.
The default ftp port is 22, but I changed it to XXXX for security reasons. I need to change it back to 22 for a short while, but when I change the port in the sshd_config file, I still have to use port XXXX to access. (That is, you can't ftp to port 22.) I've searched the rest of the file (sshd_config) and don't see the port number located anywhere else. The bottom line is the first port change from 22 to XXXX worked, but subsequent attempts to change it back to 22 have not worked even though the file shows the port to be 22.
Any ideas?
Thanks,
Chas.
The default ftp port is 22, but I changed it to XXXX for security reasons. I need to change it back to 22 for a short while, but when I change the port in the sshd_config file, I still have to use port XXXX to access. (That is, you can't ftp to port 22.) I've searched the rest of the file (sshd_config) and don't see the port number located anywhere else. The bottom line is the first port change from 22 to XXXX worked, but subsequent attempts to change it back to 22 have not worked even though the file shows the port to be 22.
Any ideas?
Thanks,
Chas.
Re: Linux problem: can't change port in sshd_config file
So I guess you went to /etc/ssh/sshd_config file and searched for port 22 line, adjusted it to the new port and updated firewall accordingly? Reverse the steps (make sure your firewall update goes back to port 22)? Did you remove the # character?
-
- Senior Member
- Posts in topic: 2
- Posts: 3269
- Joined: Sun Feb 28, 2010 1:48 am
- Location: Richmond, TX
Re: Linux problem: can't change port in sshd_config file
Sorry for the elementary question but did you restart the ssh service?
I'd be happy to look over the sshd_config file too if you want to pm it or email it to me.
I'd be happy to look over the sshd_config file too if you want to pm it or email it to me.
Psalm 91:2
-
Topic author - Site Admin
- Posts in topic: 3
- Posts: 17787
- Joined: Wed Dec 22, 2004 9:31 pm
- Location: Friendswood, TX
- Contact:
Re: Linux problem: can't change port in sshd_config file
That was it! I didn't reboot when I changed the port. As you can see, I'm green as grass when it comes to Linus.
Thanks,
Chas.
-
Topic author - Site Admin
- Posts in topic: 3
- Posts: 17787
- Joined: Wed Dec 22, 2004 9:31 pm
- Location: Friendswood, TX
- Contact:
Re: Linux problem: can't change port in sshd_config file
I used the "were is" command to find "22," changed it to a different port, then use the "write out" command. I did the same thing to change it back to port 22, but I didn't reboot the server and that was the problem.
Thanks,
Chas.
Re: Linux problem: can't change port in sshd_config file
Very good, glad you got it fixed!
-
- Senior Member
- Posts in topic: 2
- Posts: 3269
- Joined: Sun Feb 28, 2010 1:48 am
- Location: Richmond, TX
Re: Linux problem: can't change port in sshd_config file
Awesome! Glad you're in business.Charles L. Cotton wrote: ↑Sat Aug 29, 2020 1:14 pmThat was it! I didn't reboot when I changed the port. As you can see, I'm green as grass when it comes to Linus.
Thanks,
Chas.
Psalm 91:2