/etc/init.d/ssh restart does not reload the configuration
8,019
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.
Related videos on Youtube
Author by
Raphael K
Updated on September 18, 2022Comments
-
Raphael K almost 2 years
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.
-
alphamikevictor about 9 yearsDo you have the same behaviour if you make
stop
and thenstart
.
- Same issue happens if I use
-
wurtel about 9 yearsYou could have done this remotely, killing the listening daemon doesn't touch running ssh sessions. That said, it sounds like you changed the pid file location in addition to other config changes, as I've never experienced having the ssh daemon not restarting.
-
Raphael K about 9 yearsThanks for the advice about killing the daemon! I will try it out.
-
kasperd about 8 yearsThis answer sounded implausible to me, so I tested it on an Ubuntu 14.04.4 system. And it turns out this is indeed correct in the case of Ubuntu. I don't have a Debian system suitable for testing this.