Ssh – /etc/init.d/ssh restart does not reload the configuration

debiansftpssh

I've added a chroot configuration to my /etc/ssh/sshd_config.

I reload the configuration file using /etc/init.d/ssh reload, then try to connect using an SFTP client, but nothing changes, the user is able to log in but is not chrooted.

However, if I manually start an SSH daemon (on a different port) with /usr/sbin/sshd -p2222, the new configuration gets loaded and the chroot applies.

Any hint why /etc/init.d/ssh reload would not actually reload the configuration ?

Additional info:

  • Same issue happens if I use restart instead
  • While reloading/restarting, I have an open connection to the server for my root access
  • I'm running Debian Wheezy.

Best Answer

Instead of running /etc/init.d/ssh restart use service ssh restart.

On Ubuntu 14.04.2 the config changes will not occur when calling the init script directly. It's quite likely that Debian is the same here.