AdultFoundry |
10-28-2015 12:12 PM |
Not able to change SSH port
I am using the latest release of CentOS 7 on ovh.com VPS. I am going over Basic CentOS setup website, and it advises to change the SSH port (like many other websites that I've been reading now).
It looks like I am not able to do it thought, so I reversed everything to the original settings.
I was doing something like this:
Code:
vi /etc/ssh/sshd_config
#port 22 ---change to---> port 22000 (example number, 1025-65536 range)
#PermitRootLogin yes ---> PermitRootLogin no
#UseDNS yes ---> UseDNS no
AllowUsers username (add as last line)
Save and exit
After I did that I was getting something like this after running the journalctl -xn command
Code:
error: Bind to port 2750 on 0.0.0.0 failed: Permission denied.
error: Bind to port 2750 on :: failed: Permission denied.
Fatal: Cannot bind any address
Sshd.service: main process exited, code=exited, status=255/n/a
Unit sshd.service entered failed state.
Unit sshd.service cannot be reloaded because it is inactive.
I've seen some posts about it on the Internet, but I was not able to find a precise answer, especially based on CentOS7, that I have.
###
In general, I am at the default settings now, and what is advised in this article is good. When I do the changes sshd stops and it does not work, it is working currently, but it is root login at port 22.
How would I get this done?
|