0

I am trying to mount a shared drive that exists on my mac in my raspberry pi. I tried searching many different threads on stackoverflow and stackexchange and couldn't find any working solutions. I followed this guide: nixCraft sshfs and tried the steps outlined in: SSH Permission denied (publickey) [closed]. I am able to perform the reverse; ssh into rpi from my mac (as well as win10 pc). Apologize if people consider this a duplicate, but I commented on another thread asking for some assistance, however I was told to post a new question.

This is what I tried:

sshfs -o debug [email protected]:/raspi_pyfies ~/mount/ssh_macdr 

which gave me:

FUSE library version: 2.9.9 nullpath_ok: 0 nopath: 0 utime_omit_ok: 0 [email protected]: Permission denied (publickey). read: Connection reset by peer 

I also just tried sshing:

ssh -v [email protected]

and it gave me (last few lines):

debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Offering public key: /home/pi/.ssh/id_rsa RSA SHA256:##### debug1: Authentications that can continue: publickey debug1: Trying private key: /home/pi/.ssh/id_dsa debug1: Trying private key: /home/pi/.ssh/id_ecdsa debug1: Trying private key: /home/pi/.ssh/id_ed25519 debug1: Trying private key: /home/pi/.ssh/id_xmss debug1: No more authentication methods to try. [email protected]: Permission denied (publickey). 

Hopefully someone with experience can shed some light. Thanks.

2
  • Have you added the pi's public key to the MAC's authorized_keys file?
    – kaylum
    CommentedFeb 3, 2020 at 3:45
  • hi yes i did. i generated key pair from scratch. not sure what else to tryCommentedFeb 4, 2020 at 3:04

1 Answer 1

0

As noted in one of the answers to your linked question on stackoverflow, run:

ssh-keygen -t rsa 

When it asks for file in which to save the key, enter id_rsa. It's also OK to enter nothing, if you're OK with overwriting them under ~/.ssh/id_rsa.

When it asks for a passphrase, leave it empty.

Concatenate the id_rsa.pub file to the end of ~/.ssh/authorized_keys on the destination machine. Then test from the originating machine using

ssh -i id_rsa user@host 

If id_rsa is located in ~/.ssh then you can omit the -i option:

ssh user@host 

Then you've verified scp, sftp and sshfs will all work.

Important: ssh will not work if permissions on critical paths are too permissive or too restrictive. The file modes must be set as:

chmod 700 ~/.ssh chmod 644 authorized_keys chmod 600 id_rsa chmod 644 id_rsa.pub 
6
  • hi Curt, thanks for your response. I did try all those suggestions before when I searched other threads. I remove .ssh; then re-did everything from scratch. I kept on getting permission denied. I also tried changing the permissions as well. I didn't try different permissions for different files, however. I tried that just now; but no luck.CommentedFeb 4, 2020 at 3:04
  • Shoot. It does look like the Pi offered the key id_rsa and it was refused. Do you have other hosts that can ssh into the Mac? Maybe turn on debugging on the Mac side (add LogLevel DEBUG3 in /etc/ssh/sshd_config and restart ssh) and examine the system log.
    – Curt
    CommentedFeb 5, 2020 at 0:38
  • i added the DEBUG3 to the sshd_config file. It was already at DEBUG, i just added the 3. Where can I view the logs?CommentedFeb 5, 2020 at 4:06
  • so I found the log in system.log: Feb 3 21:11:56 localhost com.apple.xpc.launchd[1] (com.openssh.sshd): Unknown key for string: SHAuthorizationRight Feb 4 21:24:37 localhost com.apple.xpc.launchd[1] (com.openssh.sshd): Unknown key for string: SHAuthorizationRight Feb 4 21:41:44 username com.apple.xpc.launchd[1] (com.openssh.sshd.###): Service exited with abnormal code: 255 Feb 4 21:48:47 username com.apple.xpc.launchd[1] (com.openssh.sshd.###): Service exited with abnormal code: 255 CommentedFeb 5, 2020 at 4:09
  • i substituted jargon characters for the hastags so that it would fit as a commentCommentedFeb 5, 2020 at 4:13

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.