开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜