0

There is a similar question about slow logins here, but I believe my issue is different. Read on...

I usually use my Pi headless, SSHing in from my Macbook over WiFi. When I do, it usually takes 10-20 seconds for the password prompt to appear. While it isn't the end of the world, it is annoying.

I ran the ssh command with the -vvv parameter and this seems to be where the problem is:

debug1: Trying private key: /Users/Name/.ssh/id_rsa
debug3: no such identity: /Users/Name/.ssh/id_rsa
debug1: Trying private key: /Users/Name/.ssh/id_dsa
debug3: no such identity: /Users/Name/.ssh/id_dsa
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password

It seems it is looking for keys that are not there before finally asking for a password (where I have placed Name is actually my Macbook user name). As that path is obviously on my Mac I assume the problem lies that way, but I don't know - it could be the Pi. Performance is fine once I've logged in. Does anyone have any suggestions?

2

You may also find it useful to copy an SSH key to the Pi so you don't need to enter a password each time you connect. To do that, first check if you've already got a public ssh keyfile:

ls ~/.ssh/id_rsa.pub

If you haven't, you can generate one with:

ssh-keygen -t rsa -C "your_email@youremail.com"

Finally, copy the keyfile to ~/.ssh/authorized_keys on the Pi (there's a few different ways to do this, I used Transmit to copy it over SFTP, since I'm a Mac user. Windows users have WinSCP, and Linux users probably already know how to do it ;) ). This file contains all of the keys authorised to connect to the Pi, so will probably be blank or non-existent on a new Pi. If so, just copy id_rsa.pub to this location. If it already exists, add the key from id_rsa.pub to the end of the file.

1

You have two choices:

  1. disable all authentication methods except the password
  2. generate RSA keypair and copy the public part to your RPi (preferred)
  • Ok - how do I do the latter? – user8543 Jul 22 '14 at 14:32
  • google for "generate RSA keypair mac" ? – lenik Jul 22 '14 at 14:35
  • Wouldn't it be nice if Googling that had a chance of finding your extremely helpful answer here on Stack Exchange? – user8543 Jul 22 '14 at 14:37
  • sorry, I don't have mac, googling that particular query is totally useless for me because I cannot prove, disprove or approve the standard ssh-keygen/copy-id method due to the lack of hardware. – lenik Jul 22 '14 at 15:35

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.