How to pass password automatically for rsync SSH command?

后端 未结 13 1656
情歌与酒
情歌与酒 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:20

    Following the idea posted by Andrew Seaford, this is done using sshfs:

    echo "SuperHardToGuessPass:P" | sshfs -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no user@example.com:/mypath/ /mnt/source-tmp/ -o workaround=rename -o password_stdin
    rsync -a /mnt/source-tmp/ /media/destination/
    umount /mnt/source-tmp
    

提交回复
热议问题