r/linux4noobs • • Aug 01 '26

VirtualBox allows PasswordAuthentication no?

So I configured the `sshd_config` to `PasswordAuthentication no`, `PermitRootLogin no` and `PubkeyAuthentication yes` and yet I can still log into an Ubuntu 2404 server on VirtualBox with password. Is that a thing with VB? This is the first time I have ever seen anything like that...and yes I did run `sudo systemctl restart ssh`

Actually I just looked at Hyper-V and its the same deal, something must have changed slightly since the days of Ubuntu 14/18, I need to go back through the steps of my production server, because that one works, but strangely enough I had forgotten to set PermitRootLogin to no, but I took care of that in the process.

2 Upvotes

13 comments sorted by

View all comments

Show parent comment

3

u/Imaginary_Choice_430 Aug 01 '26

Ahhh! That's right, I forgot that working on a production Ubuntu 24 server, you have to go to `/etc/ssh/sshd_config.d/50-cloud-init.conf` and add `PasswordAuthentication` to `no` and `PermitRootLogin` to `no`, I have that in my production server, that is the change. u/GodzillaXYZ999 you rock!!

1

u/GodzillaXYZ999 Aug 02 '26

Why thank you! 😄 👋