3
I cannot ssh from my computer (OS X) to my raspberry pi (ubuntu mate), unless I use sudo. I am using a public/private keypair to authenticate.
The appropriate public key is added to the authorized_users file on the raspberry pi.
The permissions for my .ssh directory are 700. The permissions for my key files are 600.
This is the output from ssh with -v flag:
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /Users/username/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Trying private key: /Users/username/.ssh/id_dsa
debug1: No more authentication methods to try. Permission denied (publickey).
ls:
-rw------- 1 username staff 3326 May 18 23:24 id_rsa
-rw-r--r-- 1 username staff 752 May 18 23:24 id_rsa.pub
.ssh:
drwx------ 11 username staff 374 May 19 21:49 .ssh
Have you checked that
username
definitely owns.ssh
and its contents? – Paul – 2015-05-20T01:50:15.737@Paul Yes the appropriate user owns the .ssh directory and its contents – IMerin – 2015-05-20T01:51:58.350
And the .ssh directory itself? Please [edit] if you have more infomation to add to the question – Paul – 2015-05-20T01:54:28.490
@Paul, added .ssh information – IMerin – 2015-05-20T01:55:51.947
Hang on, when you do sudo it uses the root .ssh directory. What username are you logging into the rpi with? – Paul – 2015-05-20T01:57:24.553
@Paul, you're onto something here. Explicitly stating the username causes permission denied (public key), even when using sudo. It seems it's an issue with my setup on the raspberry pi, then. – IMerin – 2015-05-20T02:02:35.223
Yeah, you must be logging in a root remotely when you use sudo, so the problem probably lies in the authorized_keys of
username
– Paul – 2015-05-20T02:04:11.780