Why can I still ssh into my Ubuntu machine using a password? This is the
/etc/ssh/sshd_config file of my Ubuntu 20.04 on ovh hosting (showing only non-commented lines for brevity):
AllowUsers user1 user2
AuthorizedKeysFile .ssh/authorized_keys .ssh/authorized_keys2
AcceptEnv LANG LC_*
Subsystem sftp /usr/lib/openssh/sftp-server
The permissions of the relevant files seem to be OK:
$ stat -c %a /home/user1/.ssh/
$ stat -c %a /home/user1/.ssh/authorized_keys`
I have run
sudo service ssh restart and
sudo service sshd restart.
Why am I still able to log into my Ubuntu machine by password over ssh? I can login by user and password over ssh (PuTTY), it only asks for password. Both user1 and user2 have their key in .ssh home folder. What is missing?
I checked the include file:
-rw------- 1 root root 27 Dec 1 12:52 50-cloud-init.conf
...:/etc/ssh/sshd_config.d$ sudo cat 50-cloud-init.conf
so I guess that is the cause? However, wouldn’t my config overwrite this setting? since it is included above (line wise)?