0

I'm setting up a new Ubuntu 24.02 Server VM, and to my surprise, after editing the /etc/ssh/sshd_config and after checking the config file syntax with an sshd -t and restarting the service via sudo systemctl restart sshd it just kept on going with the same config as before.

I've made some pretty noticeable changes to the configs, like changing port and disabling password auth, and they only took place once I reboot the whole machine.

Is there a particular reason why sshd is behaving like this? Thanks in advance!

1 Answers1

2

The proper way (as of Ubuntu 22.04 or 22.10) to restart ssh after altering /etc/ssh/sshd_config is ...

sudo systemctl daemon-reload
sudo systemctl restart ssh.service

https://askubuntu.com/a/1439482/15811 has an explanation. Important part:

# Port and ListenAddress options are not used when sshd is socket-activated,
# which is now the default in Ubuntu. See sshd_config(5) and
# /usr/share/doc/openssh-server/README.Debian.gz for details.
Rinzwind
  • 309,379