Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

My Raspberry Pi is running the default Debian image and has SSH enabled. I log into my Pi as follows:

ssh pi@<IP-address-of-my-Pi>

I have to enter my password every time. Can I somehow make my Pi accept log ins from my local machine? I am running Fedora Linux.

share|improve this question

migrated from raspberrypi.stackexchange.com Jul 9 '12 at 18:27

This question came from our site for users and developers of hardware and software for Raspberry Pi.

    
It's a question specific to users or developers (interacting via SSH-clients) of the Raspberry Pi (used as an SSH-Server), so it should be OK to ask, if I interpret the FAQ correctly. –  Bengt Jul 3 '12 at 23:09
2  
We've come to a consensus that if you could not tell if a question is about the Raspberry Pi if all references to it is removed, then it is off-topic. We also discuss questions before deciding that they are better off closed in the official chat room. Feel free to join in if you have a question! –  Bryan Dunsmore Jul 3 '12 at 23:17

2 Answers 2

up vote 10 down vote accepted

Yes, you can automate the authentication with your Raspberry Pi using SSH.

As prerequisites the following is required:

Linux

Under Linux you can install SSH via you package manager, generate a keypair using ssh-keygen, copy the key to the Pi using ssh-copy-id and test using ssh.

Install SSH on Linux

Most Linux distributions come with an SSH-client preinstalled. If you should for some reason not have one, install it using your package manager:

For RPM-based Linux distributions (eg. Fedora and Suse):

sudo yum install ssh

For DEB-based Linux distributions (eg. Debian and Ubuntu):

sudo apt-get install ssh

Generate a Keypair on Linux

First, you will need a public/private keypair. So if you don't have one, run the following command to generate a keypair with the default settings.

$ ssh-keygen
generating public/private rsa key pair.
Enter file in which to save the key (/home/user/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user/.ssh/id_rsa.
Your public key has been saved in /home/user/.ssh/id_rsa.pub.
The key fingerprint is:
24:55:ee:67:83:72:82:55:5f:b9:b4:09:2a:fa:56:a1 user@client.local
The key's randomart image is:
+--[ RSA 2048]----+
|                 |
|                 |
|                 |
|         +    .  |
|        S    E   |
|         .  + +  |
|          .o . o.|
|         o.oo. oo|
|          ==o.BO+|
+-----------------+

Copy the Public Key to the Pi on Linux

Secondly, you will need to copy the generated public key to the machine you want to log to without a password. So, run the following command on the machine and as the user, you want to be able to access the Pi:

$ ssh-copy-id pi@<IP-address-of-your-Pi>
Password:
Now try logging into the machine, with "ssh 'pi@<IP-address-of-your-Pi>'", and check in:
  .ssh/authorized_keys
to make sure we haven't added extra keys that you weren't expecting.

SSH into the Pi on Linux

Finally, log in using SSH, to verify that no password is requested:

$ ssh pi@<IP-address-of-your-Pi>
share|improve this answer
    
Maybe you are right. That should be an own question, thought. I will create one if it doesn't exist and link it here. –  Bengt Jul 3 '12 at 21:40
    
I've added the explanation on how to generate a key, its waiting for peer review –  user689893 Jul 3 '12 at 21:43
    
@bngtlrs you may want to clarify that these instructions don't work on a Windows PC and ideally explain how to do this froma PC. –  Steve Robillard Jul 3 '12 at 22:00
    
@SteveRobillard I have no clean solution for windows. Maybe I should make clearer, that the question is Linux-specific and someone else should care about windows in another question. –  Bengt Jul 3 '12 at 22:21
    
@bngtlrs If I get a chance tomorrow I will post an answer for the windows crowd if you don't mind alternatively I could make an edit to your post for your review and approval. –  Steve Robillard Jul 3 '12 at 22:29

Check the permissions on the files you're trying to copy to make sure the user you're logging in as over ssh has permission to read them.

share|improve this answer
1  
The OPs issue is with logins, not copying files... –  jasonwryan Nov 30 '12 at 7:34
    
Yes, my question was about copying my id. You, Joe, are in principle right about that permissions can cause issues when trying to log in, but that should be handled in another Q&A. –  Bengt Nov 30 '12 at 11:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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