TXT
Reply to comment
Share SSH Public Key Authentication
Submitted by enzo on Wed, 02/03/2010 - 14:57Sometimes you have access in a server using SSH, but is annoying type your username and password every time do you want access this server, below you can find the instructions to share ssh credentials to avoid manual authentication.
1. Key Generation
The public portion of the RSA key pair must be copied to any servers that will be accessed by the client.
client$ mkdir ~/.ssh
client$ chmod 700 ~/.ssh
client$ ssh-keygen -q -f ~/.ssh/id_rsa -t rsa
Enter passphrase (empty for no passphrase): ...
Enter same passphrase again: ...
The file permissions should be locked down to prevent other users from being able to read the key pair data. OpenSSH may also refuse to support public key authentication if the file permissions are too open. These fixes should be done on all systems involved.
client$ chmod go-w ~/
client$ chmod 700 ~/.ssh
client$ chmod go-rwx ~/.ssh/*
2. Key Distribution
The public portion of the RSA key pair must be copied to any servers that will be accessed by the client.
# first, upload public key from client to server
client$ scp ~/.ssh/id_rsa.pub server.example.org:~
# next, setup the public key on server
server$ mkdir ~/.ssh
server$ chmod 700 ~/.ssh
server$ cat ~/id_rsa.pub >> ~/.ssh/authorized_keys
server$ chmod 600 ~/.ssh/authorized_keys
server$ rm ~/id_rsa.pub
After complete this process maybe do you want read an article about how sync remote folder here
Enjoy it.
enzo

