I configured Ubuntu 24.04's sshd_config with PasswordAuthentication no, PermitRootLogin no, and PubkeyAuthentication yes. I restarted the SSH service with sudo systemctl restart ssh, but I can still connect to the VirtualBox VM using a password. The same behavior occurs with a Hyper-V VM, so it doesn't appear to be specific to VirtualBox. Has something changed in newer Ubuntu releases, or is another SSH setting overriding my configuration?
1 Answer
The setting you changed only disables the password authentication method itself; it doesn’t necessarily disable every authentication method that can prompt for a password. Check the complete effective sshd configuration rather than relying only on sshd_config, especially the files under /etc/ssh/sshd_config.d/. Also make sure you’re testing a normal user account and not accidentally connecting through another service or configuration.

The SSH service was already restarted, so I’ll focus on checking the effective configuration and the additional files included by the newer Ubuntu setup.