How to pass password automatically for rsync SSH command?

后端 未结 13 1659
情歌与酒
情歌与酒 2020-12-02 05:39

I need to do rsync by ssh and want to do it automatically without the need of passing password for ssh manually.

13条回答
  •  囚心锁ツ
    2020-12-02 06:10

    I got it to work like this:

    sshpass -p "password" rsync -ae "ssh -p remote_port_ssh" /local_dir  remote_user@remote_host:/remote_dir
    

提交回复
热议问题