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?

user8543
  • 185
  • 1
  • 1
  • 9

2 Answers2

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.

Milliways
  • 59,890
  • 31
  • 101
  • 209
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)
lenik
  • 11,541
  • 1
  • 30
  • 37