Yes, you can automate the authentication with your Raspberry Pi using SSH.
As prerequisites the following is required:
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
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.
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:
The key's randomart image is:
+--[ RSA 2048]----+
| + . |
| S E |
| . + + |
| .o . o.|
| o.oo. oo|
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>
Now try logging into the machine, with "ssh 'pi@<IP-address-of-your-Pi>'", and check in:
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>