The following approach is what I consider the most straightforward way, while due to different server's restriction, the usability of such approach may differs.
MISSION:
Log into "Server B" from "Server A", or transfer file from "Server A" to "Server B' without password.
PROCEDURE:
1. log into "Server A", go to ~/.ssh directory (currently, there should be no id_rsa or id_rsa.pub files)
2. run command line: ssh-keygen -t rsa (just press 'Enter' all the way down, you will see two files are generated)
3. log into "Server B" using password, then append the context in "Server A" 's id_rsa.pub file into the "Server B" 's ~/.ssh/authorized_keys file.
4. Now if you are in "Server A", then you can feel free to "scp file-from-server-B location-on-server-A" or "scp file-from-server-A location-on-server-B" or "ssh server-B" directly.
NOTE:
Seems like some server are configured in a way that it cannot use generated ssh-key to access other server? (not sure) So it is always a good idea to consult the server management people first on these issues.
Good luck with multiple servers communication :)
No comments:
Post a Comment