I am trying to ssh into my Pi from a Mac, but the authentications are failing.

My passphrase was set up to be an empty passphrase (although I also tried to use a non-empty phrase, but it fails in the same way).

I have setup both id_dsa and id_rsa private keys as shown below:

enter image description here

What additional thing do I need to do to get this ssh to succeed?


Have you copied contents of your ~/.ssh/id_rsa.pub from your Mac to the ~.ssh/authorized keys file on the RPi?

Assuming the keys are correct, what are the permissions on ~/.ssh on the RPi? They should be 0700.

  • How do I do that? I'm trying to ssh into the RPi so that I can modify it. I don't have a standalone terminal, just my Mac. Seems like a chicken and egg thing. – JeffB6688 Jul 17 '15 at 18:43
  • @JeffB6688 hahaha what? if you did not copy your key over yet and you are using a fresh OS, you need to use the default password ("raspberry" or look it up for whatever OS you are using) – user1133275 Jul 17 '15 at 19:56
  • 1
    @JeffB6688 And for the love of god, please change the pi password before exposing your system to the outside world. As said above, initially connect using the pi account password, then append the contents of the id_rsa.pub file to ~/.ssh/authorized_keys. Test it to make sure it works, then you can disable password logins by editing /etc/ssh/sshd_config and changing PasswordAuthentication to no. Be sure you can log in using the key before doing this so you don't lock yourself out. It sounds like that's what you may have done. Can you plug in a keyboard and display? – bobstro Jul 17 '15 at 20:57
  • @bobstro Yes, that was foolish of me publishing my ip address info. I felt it best to delete that info from this question, which make the question useless. I will try your suggestions. I realize now that I need to get a keyboard and monitor to do this, rather than trying to connect via my Mac (at least initially). – JeffB6688 Jul 17 '15 at 21:31
  • Please do not expose your system before you have it buttoned down! Don't allow the ability to use sudo without a password. (sudo visudo1) and comment out (#) or delete #pi ALL=(ALL) NOPASSWD: ALL. If the RPi is on the same network, you can disable password authentication as the default in /etc/ssh/sshd_config (PasswordAuthentication no) while allowing a local override (Match Address X.X.X.0/24 PasswordAuthentication yes) for your subnet in case you goof again. I also restrict ssh to specific users with AllowGroups (or AllowUsers) and NOT allowing user pi. Install fail2ban. – bobstro Jul 18 '15 at 3:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.