I recently created a new VM running Ubuntu 20.04.3 server, and to use key pair authentication for the SSH server, I created the key pair with ssh-keygen and enabled PubkeyAuthentication yes within /etc/ssh/sshd_config, but I'm unable SSH in via:
ssh -i ~/.ssh/id_rsa [email protected]
/etc/ssh/sshd_config:
(Turning off password authentication and allowing only key authentication didn't work either)Include /etc/ssh/sshd_config.d/*.conf PermitRootLogin yes PubkeyAuthentication yes PasswordAuthentication yes ChallengeResponseAuthentication no UsePAM yes X11Forwarding yes PrintMotd no AcceptEnv LANG LC_* Subsystem sftp /usr/lib/openssh/sftp-server- I want to be able to log in to the server without having the public key within the server's
authorized_keys