How to remote SSH login Raspberry Pi without using password on Ubuntu

 
 
   In this post, I'm going to share How to SSH login Remote Server (Raspberry Pi) without using password .

  SSH is a secure cryptographic network protocol that can be use between two connected host for data communication, over an unsecured environment . SSH uses private key and public key in the encryption and decryption process

  Private key is a read only key and only meant for your local host.This key is stored in your local machine.Public key is a key that is stored in the machine that you want to log in to. Public key  is stored in  ".ssh/authorized_keys" remote machine folder. If you have multiple machine that you want to log into ,you need to setup all the machine using the same public key .

 Public key on the remote machine is use to encrypt the message that will transfer over the network while private key on your local machine is use to decrypt the message .As a security measure, SSH program store the private key in protected  pass phrase. If your machine or stolen, you should able to change or disable your old public key. For more info on SSH and public key cryptography, please read here and here

  In this post,I'm using my Raspberry Pi as a remote server . I will not setting the passphrase private and public key in this tutorial. You are free to do so if you want to .

Steps

1. Create public and private keys  on your local host.

shark_attack@Positive-Space:~$ ssh-keygen

2.Copy the public keys from the local host to the remote server ".ssh/authorized_keys "  .

shark_attack@Positive-Space:~$ ssh-copy-id -i ~/.ssh/id_rsa.pub pi@10.42.0.68

In the example above, "pi" is my username and "10.42.0.68" is my Remote server (Raspberry Pi)  IP .

3. Try to login from Local host to Remote host.


Read Previous : How to write VNC Server and VNC client startup Bash script
Read Next : How to convert video file type with robot feedback voice using bash script