- generate public key ssh-keygen -t rsa -b 4096
- place it in ~/.ssh/authorized_keys
- set 'PasswordAuthentication' to no in /etc/sshd_config
- restart service
- ssh localhost -vvv
Note: trying to ssh from my phone (with the .pub key in the authorized_keys folder) did not work either.
Note: both work if I enable password authentication.
Google, namely, ubuntu's documentation, told me this could stem from improper (or overly lax) file permissions but:
λ space ~ → sudo ls -l ~/.ssh/ total 12 drw------- 2 desktop desktop 4096 Feb 17 00:36 authorized_keys -rw------- 1 desktop desktop 3243 Feb 17 00:36 id_rsa -rw-r--r-- 1 desktop desktop 171 Feb 16 23:40 known_hosts
All fine and dandy. Then I tried to disable StrictMode in sshd_config, but it did not work either.