- Assuming you want to setup password less ssh login for user "user-1" from host "machine-1" to user "root" on host "machine-2"
- Login into "machine-1" as "user-1"
- Check if there exists a file "/home/user-1/.ssh/id_rsa.pub" (Note dot . before ssh). If this file exists then go to step 5
- Run this command with all default values
- ssh-keygen -t rsa
- Run this command to copy "/home/user-1/.ssh/id_rsa.pub" file to remote host
- ssh-copy-id -i root@machine-2
- Try login into remote machine and verify that it does not ask for any password
- ssh root@machine-2
- You can also directly run commands on remote machine
- ssh root@machine-2 hostname
References :-
- http://www.linuxproblem.org/art_9.html
- http://www.thegeekstuff.com/2008/11/3-steps-to-perform-ssh-login-without-password-using-ssh-keygen-ssh-copy-id/
No comments :
Post a Comment