SSH fails after Port change on CentOS 7

General support questions
Post Reply
coffeelyme
Posts: 1
Joined: 2018/12/23 07:05:10
Location: New York
Contact:

SSH fails after Port change on CentOS 7

Post by coffeelyme » 2018/12/23 07:09:26

After changing the port.

And restarting the SSH service, it failed on me.

I got the following info when I ran systemctl status sshd.service:

sshd.service: main process exited, code=exited, status=255/n/a
Unit sshd.service entered failed state.
sshd.service failed.
Any suggestions on how do I fix this (newb here)? :?:

poky
Posts: 108
Joined: 2013/03/27 12:18:03

Re: SSH fails after Port change on CentOS 7

Post by poky » 2018/12/23 10:24:57

Try temporaly disable selinux and restart sshd sedvice:

setenforce 0
systemctl restart sshd
systemctl status sshd

drk
Posts: 405
Joined: 2014/01/30 20:38:28

Re: SSH fails after Port change on CentOS 7

Post by drk » 2018/12/24 07:09:44

Check the output of:

Code: Select all

semanage port --list | fgrep ssh
if it doesn't include your new sshd port then semanage is the command that you use to add it.

Post Reply