1

I am using Linux Mint 18, the same distribution I have been using most of the semester for school. I was tasked with making certain adjustments to the sshd_config file, including chaning the listening port to 444, only allowing protocol 2, only allowing myself to login and not the other user named "otheraccount", not allowing root login, disabling the login of accounts with empty passwords, and creating a welcome banner. After using sudo and saving the sshd_config file, I go ahead and try to restart ssh using the sudo /etc/init.d/ssh restart but I get an error.

The error reads "Restarting ssh (via systemctl): ssh.serviceJob for ssh.service failed because the control process exited with error code. See "systemctl status ssh.service" and "journalctl -xe" for details. Underneath this message it reads "failed!" in red lettering.

  • 3
    And what does it say for systemctl status ssh? – AlexP Dec 6 '16 at 16:53
2

The problem in this case is SELinux (Security Enhanced Linux) which prevents the ssh running on that port.

To solve the problem use the following:

1) Change the type context for the ssh service using semanage as follow

semanage port -a -t ssh_port_t -p tcp 444

2) Restart ssh service

systemctl restart sshd  && systemctl status sshd

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.