远程使用rsync时没有密码提示?

Dom*_*que 2 linux bash rsync

我有一个执行 rsync 传输到远程位置的 bash 脚本,每次执行该脚本时,都会要求我输入密码。

有没有办法避免这种情况?

这是我使用的命令: rsync -av /source usr@ip:/destination

Hau*_*ing 6

使用rsync了SSH和使用SSH密钥没有密码。

man rsync

-e, --rsh=COMMAND         specify the remote shell to use
Run Code Online (Sandbox Code Playgroud)

rsync -e ssh ...

  • @Dominique 这只能在配置 SSH 后完成。这不是你所做的替代品。 (2认同)