I have changed the default port number in /etc/ssh/sshd_config
.
When I start ssh service it does start,
but when I run service sshd status
it is stopped:
I am using CentOS 6.4.
I have changed the default port number in /etc/ssh/sshd_config
.
When I start ssh service it does start,
but when I run service sshd status
it is stopped:
I am using CentOS 6.4.
I'm assuming your question is "why sshd
keeps stopping after you've changed the port?"
CentOS has SELinux enabled by default, and sshd
is one of the system services targeted by the SELinux policy. The policy restricts what the sshd
process can do. So when you change sshd
to a different port, you'll also need to add the appropriate label to the new port or else sshd
will be prevented from using that port by SELinux.
To see the SELinux port labels: semanage port -l
To label port 444 for sshd
, you'll need to do this:
semanage port -a -t ssh_port_t -p tcp 444
Then you can start sshd
in a custom port:
service sshd start