开发者

shell script rsync password file option

开发者 https://www.devze.com 2023-01-27 10:45 出处:网络
In a shell script how to use rsync --password-file option rsync -a r开发者_开发技巧oot@123.123.12.3:/root /backup

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消