Backup
-
We use scp to transfer backup file in each server to a centralized backup server. We need to setup quick login with ssh Client Keys.
-
Generate a public/private key pair in the centralized backup server
ssh-keygen –t rsa
Just hit Enter when asked, this leave the passphrase empty.
This created two files, ~/.ssh/id_rsa and ~/.ssh/id_rsa.pub. -
Copy id_rsa.pub to the server that you wish to use quick login. Create the .ssh folder if needed.
scp /root/.ssh/id_rsa.pub root@host:/root/.ssh/authorized_keys2Note: Copy the contents of id_rsa.pub and paste to “/root/.ssh/authorized_keys2” the server that you wish to quick login, when more than 1 server that would liked to use quick login to the particular server.
-
In order to allow the server to backup itself, you can copy the content of id_rsa.pub and adding into authorized_keys2.
-
-
Synchronize backup file within localhost.
rsync -zvr /file/hd1/* /backup/hd1