If you want to log onto Server A, and then ssh to Server B without using a password, do the following...
1) Log onto Server A
2) Type: cd .ssh
3) Type: ssh-keygen -t rsa
Hit return for all prompts. Use default file name. Do NOT supply a passphrase. This will create both private (id_rsa) and public (id_rsa.pub) key files.
4) Type: cat id_rsa.pub | ssh userB@machineB "cat - >> .ssh/authorized_keys"
You will be prompted for the password of userB, go ahead and type it.
5) At this point, you are done. You will be able to connect to userB on server B, FROM userA on severA without supplying a password.
6) Test: ssh userB@serverB
This should log you onto Server B with no password.
Do the same from Server B to Server A, if you want to be able to do it from either direction
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment