Rsync via PHP exec() with SSH passwordless ssh login

前端 未结 5 908
刺人心
刺人心 2020-12-30 08:30

If I run the command via php exec(): It does not work. But if I use bash, it runs perfect. Any idea what the problem might be.? I was thinking maybe it is executing rsync as

5条回答
  •  执笔经年
    2020-12-30 09:04

    Here's how you specify where should SSH pick up your keys:

    exec('rsync -e "ssh -i /home/you/.ssh/id_dsa" ...')
    

    I assume that Apache runs under user that can read your id_dsa or id_rsa.

提交回复
热议问题