C 7.3 Sshd Will Not Reload

Home » CentOS » C 7.3 Sshd Will Not Reload
CentOS 7 Comments

Hi,

Since upgrading to 7.3 I am having a problem getting sshd to reload after configuration changes. When I issue the command “systemctl reload sshd.service”

I get the following error: “Unit sshd.service cannot be reloaded because it is inactive.”

It is obviously still running because I am connected over SSH to the machine and netstat shows it is listening.
(vnewman pts3) # netstat -tulpn | grep ssh tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 29249/sshd tcp 0 0 127.0.0.1:6010 0.0.0.0:* LISTEN 3012/sshd: root@pts
(vnewman pts3) #

If I reboot the machine, then everything is OK.

Has anyone seen this behavior or more importantly know how to fix it?

Regards,

7 thoughts on - C 7.3 Sshd Will Not Reload

  • Might I suggest using “systemctl restart sshd”, instead of reload? At the least – see if it behaves differently for you.

    – *restart* = stop + start
    – *reload* = remain running + re-read configuration files.

  • Hi,

    restart, reload, stop then start all produce the same results.

    If I do not change the configuration, and just issue the restart, reload, etc. then it behaves as expected. Obviously that is not useful when you have configuration changes.

    I tested this on a couple of other VM’s and get the same results.

    Regards,

  • I have to assume it’s something unique to your install, then.

    I run about a dozen sshd instances on as many CentOS 7 boxes around here. To a one, systemctl restart sshd is all it takes to implement config changes.

  • Did you actually change something before doing the restart? If nothing changes it will restart every time. If I change the configuration to for instance have sshd listen on another port, that is when I have the problem. Oh and selinux is in permissive.

    There is nothing special about the environment. a couple of VM’s in question are brand new minimal installs. I spin them up for testing push new sshd configs to them with Ansible and tear them down.

    Before someone says Ansible is the problem I have tried this by hand also.

    Regards,

  • Oh yea!

    That’s how I test/implement new configurations.

    Make a change restart test make a change Lather, rinse and repeat

LEAVE A COMMENT