Step 1:
> ssh-keygen -t rsa
Enter to generate id_rsa.pub and id_rsa
Check the private and public key generated in ~/.ssh/ folder
Step 2:
>ssh-copy-id -i ~/.ssh/id_rsa.pub username@remotehost
while doing this step, you have to enter the password
For Eg: ssh-copy-id -i ~/.ssh/id_rsa.pub root@192.168.168.26
root@192.168.168.26's password:
Now try logging into the machine, with "ssh 'root@192.168.168.26'", and check in:~/.ssh/authorized_keysto make sure we haven't added extra keys that you weren't expecting.
root@192.168.168.26's password:
Now try logging into the machine, with "ssh 'root@192.168.168.26'", and check in:~/.ssh/authorized_keysto make sure we haven't added extra keys that you weren't expecting.
Step 3:
ssh username@remotehost
Now it will login without password
No comments:
Post a Comment