How to scp and ssh from Ubuntu to a Raspberry Pi without a password

From your local machine, be able to log in or rcp or rsync files to the rpi without having to enter a password.  This enables automated scripts to push code to the rpi as a server, or to automate backups.
  1. Create a local .ssh directory with cd ~; mkdir .ssh
  2. Create a public/private key pair with ssh-keygen -t rsa (take all the defaults when prompted)
    • The private key is ~/.ssh/id_rsa
    • The public key is ~/.ssh/id_rsa.pub
  3. Copy the public key to the remote rpi with scp id_rsa.pub pi@192.168.1.100:./ (your ip address may be different)
  4. ssh to the rpi with ssh pi@192.168.1.100
  5. Create a .ssh directory with mkdir .ssh
  6. Move id_rsa.pub to the .ssh directory and rename it with mv id_rsa.pub .ssh/authorized_keys
  7. Test with ssh pi@192.168.1.100 - you should be logged in without entering a password.