通过PHP的exec的rsync()与密码的SSH SSH登录 [英] Rsync via PHP exec() with SSH passwordless ssh login

查看:131
本文介绍了通过PHP的exec的rsync()与密码的SSH SSH登录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我通过PHP的exec()运行命令:它不工作。但是,如果我使用bash,它运行完美。任何想法,问题可能是什么?我想也许这是执行rsync的Apache和不允许ssh登录。

  EXEC('的rsync -au的/ var / www / html等/ F1 / user@000.000.000.000:在/ var / www / html等/ F2 /');


解决方案

由于没有上述建议会的工作,我必须允许,我需要上传图片过于服务器Apache用户帐户密码访问。它就像我的魅力,就像需要,谢谢所有试图帮助我的问题。

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 apache and not allowing ssh login.

exec('rsync -au /var/www/html/f1/ user@000.000.000.000:/var/www/html/f2/');

解决方案

Since none of the above suggestions would work, I had to allow the Apache user account passwordless access to the server I needed to upload images too. It works like I charm, just as needed, Thank you to all that attempted to help with my issue.

这篇关于通过PHP的exec的rsync()与密码的SSH SSH登录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆