SSH and SCP from local to remote machine without password

I am going to explain easiest and more common way to perform SSH and SCP from local to remote machine without password authentication
Following steps explains how to perform SSH and SCP from local-host to a remote-host without entering the password on openSSH system
1. Verify that local-host and remote-host is running openSSH
On the terminal of both local and remote machine by using ssh -V command you can verify it..!!

1

2. Generate key-pair on the local-host using ssh-keygen

2
The public key and private key are typically stored in .ssh folder under your home directory.
By default the ssh-keygen on openSSH generates RSA key pair. You can also generate DSA key pair using: ssh-keygen -t dsa command.

3. Install public key on the remote-host.
Copy the content of the public key from the local-host and paste it to the .ssh/authorized_keys on the remote-host. If the .ssh/authorized_keys already has some other public key, you can append this to the end of it.

3

4. Give appropriate permission to the .ssh directory on the remote-host.
4

5. Start the SSH Agent on local-host to perform ssh and scp without having to enter the pass-phrase several times.
Load the private key to the SSH agent on the local-host by using ssh-add.
6
6. Perform SSH or SCP from local-host to remote-host without entering the password.

7

Here remote machine having ip 192.168.19.131 and by typing above command you can get the remote machine shell without password authentication.
8
you can also copy the files from local-host to remote host by using scp as mentioned below.
9
Please leave your comments and feedback regarding this article.
Subscribe with us to get updated with daily news.

Also Know PGP and GPG Secure Data Communication on two Linux machine

Thank you.

Leave a Comment