简体   繁体   English

通过PHP Exec进行SSH

[英]SSH via PHP Exec

I'm trying to build a deployment tool on PHP for a few sites on wpengine. 我正在尝试在PHP上为wpengine上的几个站点构建部署工具。 I'm trying to connect via ssh but i'm getting the error: 我正在尝试通过ssh连接,但出现错误:

Permissions 0755 for '/var/www/.ssh/id_rsa' are too open. “ /var/www/.ssh/id_rsa”的权限0755太开放了。 It is required that your private key files are NOT accessible by others. 要求他人不能访问您的私钥文件。 This private key will be ignored. 此私钥将被忽略。

I've tried updating the permissions using chmod to 600 - which is successful but the prompt still show 0755... 我尝试使用chmod将权限更新为600-成功,但是提示仍然显示0755 ...

Any ideas? 有任何想法吗?

SSH uses a private list of valid keys. SSH使用有效密钥的私有列表。 this list need to be read and write for the user. 该列表需要为用户读取和写入。

The PHP script surely access to this list, and check the access to it. PHP脚本肯定会访问此列表,并检查对它的访问。 755 say that is almost public. 755说几乎是公开的。 and it ts "too open" 它“太开放”

Try to use in PHP the same users that own this file, and change the access to 700 尝试在PHP中使用拥有此文件的相同用户,并将访问权限更改为700

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM