Setup ssh key authentication for password-less login between servers. For use by ssh/sftp users or scripts.
Source Server (or local system)
Generate RSA key for user on this system, you can also use DSA. This asks for key pass-phrase but you can leave it blank.
1
|
|
This asks for location to place the generated key, by default it will be your home directory (ex: /home/your_username/.ssh/). This generates two files: id_rsa and id_rsa.pub. Content of id_rsa.pub is what we need to copy to destination server.
Destination Server (or remote server)
Check if you have the directory .ssh on your home (ex: /home/username/.ssh/), if not, create that directory.
1 2 |
|
Check if you have existing file authorized_keys on your .ssh directory, if not create it.
1 2 |
|
Copy content of id_rsa.pub that you created from your source/local server, or execute this command from your source/local server:
1
|
|
Test your password-less login from source to destination server.