I am running 24.04 server and I am trying to prohibit password logins. In /etc/ssh/sshd_config I set "PasswordAuthentication no" and restarted shh service (sudo systemctl restart ssh). I am still have to login via password.
Just for tests, in /etc/ssh/sshd_config I set "PasswordAuthentication maybe" which gave me errors when I tried restarted shh service, so I know sshd_config is being read.
On my Debian machien there is a separate ssh and sshd service so I tried restarting/starting sshd
Code:
Failed to restart sshd.service: Unit sshd.service not found.
Failed to start sshd.service: Unit sshd.service not found.
I don't remember having this issue in 22.04, I've only had to set "PasswordAuthentication no" to disable ssh password logins.
Any help would be great, thank you
~Pard
EDIT: Well guess in order to solve my problems I first need to post about it. As soon as I posted I saw the 24.04 ships with /etc/ssh/sshd_config.d/50-cloud-init.conf .... whish sets "PasswordAuthentication yes". Remove it and problem solved.
Bookmarks