Pages

Sunday, June 4, 2017

How to synchronize file server without password root with SSH keygen on Centos 6


# ssh-keygen

ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/root/.ssh/id_rsa): 
Enter passphrase (empty for no passphrase): 
Enter same passphrase again: 

NB: Please dont put password (Only Enter)

Your identification has been saved in /root/.ssh/id_rsa.
Your public key has been saved in /root/.ssh/id_rsa.pub.
The key fingerprint is:
41:71:f3:9b:14:tc:6f:de:fa:m1:05:c5:0d:65:b6:b7 root@svr7.server.co.id
The key's randomart image is:
+--[ RSA 2048]----+
|        o.oo. .+*|
|       . ..o.. ++|
|        .  .o ...|
|         . .oo .o|
|        x  oo. w.|
|            .... |
|             .o  |
|            .  . |
|             ..  |
+-----------------+



Copy id_rsa to server destination

# ssh-copy-id -i ~/.ssh/id_rsa.pub 192.9.18.25




Synchronize Script

# rsync -avz --delete /mnt/test/ root@192.9.18.25:/mnt/test/