shell script rsync password file option
In a shell script how to use rsync --password-file
option
rsync -a r开发者_开发技巧oot@123.123.12.3:/root /backup
If protocol is rsync you can use:
rsync -a --password-file=/path/to/secret rsync://root@123.123.12.3/root /backup
If rsync over ssh used, you should setup public key ssh auth. On local host run
ssh-keygen -t rsa -b 1024
then add content of ~/.ssh/id_rsa.pub to ~/.ssh/authorized_keys on remote host.
精彩评论