Step 1: Create public and private keys using ssh-key-gen on local-host
$ ssh-keygen
followed by a few "enter".
Note: Generate ~/.ssh/id_rsa.pub
Step 2: Copy the public key to remote-host using ssh-copy-id
# Assume: 1.2.3.4 is remote-host IP address$ ssh-copy-id -i ~/.ssh/id_rsa.pub 1.2.3.4
Note: ssh-copy-id appends the keys to the remote-host’s .ssh/authorized_key.
Step 3: Login to remote-host without entering the password
# Assume: user3 is a user name.$ ssh user3@1.2.3.4
No comments:
Post a Comment