Skip to content

Create ssh login for without password needed in future

Updated: at 09:12 AM

To enable passwordless SSH login using RSA certificates, you need to generate an RSA key pair on your local machine, and then copy the public key to the remote server you want to access.

Local Computer (GalaxyPro) --------> Server (172.16.200.100)

Step 1: Generate an RSA Key Pair

On your local machine, open a terminal and run the following command to generate an RSA key pair:

pujan@GalaxyPro:~$ ssh-keygen -t rsa

Step 2: Copy the Public Key to the Remote Server

Now, transfer your public key (id_rsa.pub) to the remote server. There’s a convenient command for this purpose:

pujan@GalaxyPro:~$ ssh user@172.16.200.100 mkdir -p .ssh # Optional if does not exist
pujan@GalaxyPro:~$ cat ~/.ssh/id_rsa.pub | ssh user@172.16.200.100 'cat >> .ssh/authorized_keys'
pujan@GalaxyPro:~$ ssh user@172.16.200.100 "chmod 700 .ssh; chmod 640 .ssh/authorized_keys"

Step 3: Test Passwordless SSH Login

Finally, test your setup by SSH’ing into the server:

pujan@GalaxyPro:~$ ssh user@172.16.200.100