§2024-05-26

¶ssh - Permission denied (publickey), ubuntu 24.04, raspi model 3 B <<<-- not resolved yet

alexlai@opi58G:~/Downloads$ ssh ubuntu@192.168.2.201    <-- ubuntu is the default user
ubuntu@192.168.2.201: Permission denied (publickey).
alexlai@opi58G:~/Downloads$ ssh 192.168.2.201
alexlai@192.168.2.201: Permission denied (publickey).

GPT,

  1. Incorrect Permissions on SSH Keys: ???
chmod 600 ~/.ssh/id_rsa
chmod 700 ~/.ssh
$ ls -al ~/
..
drwx------  2 alexlai alexlai   4096 May 22 12:54  .ssh
alexlai@opi58G:~/Downloads$ ls -al ~/.ssh/
total 32
drwx------  2 alexlai alexlai 4096 May 22 12:54 .
drwxr-xr-x 29 alexlai alexlai 4096 May 19 07:29 ..
-rw-------  1 alexlai alexlai 9376 May 26 07:15 known_hosts
-rw-------  1 alexlai alexlai 8256 May 22 12:54 known_hosts.old
  1. Incorrect Public Key on Server:

    Verify that your public key (id_rsa.pub or equivalent) is correctly added to the ~/.ssh/authorized_keys file on the server. Ensure each key is on a single line. Ensure the permissions of the ~/.ssh directory and the authorized_keys file on the server are correct:

    sh

chmod 700 ~/.ssh chmod 600 ~/.ssh/authorized_keys