通过PHP添加FTP用户的安全方法是什么?
网站上有一个表单,其中包含用于管理员的“ FTP用户名”和“ FTP密码”。
如何通过PHP安全地添加FTP用户?因为当前我们正在通过SSH -root-用户连接到服务器,这是最糟糕的解决方案。因此,对于辅助解决方案,我们将其添加到Sudoers中,仅启用了几个命令。
echo "testuser ALL=(ALL) NOPASSWD:/bin/mkdir,/bin/rmdir" > /etc/sudoers.d/testuser
但是userAdd
命令呢?如果我们也允许普通用户,那也不是安全的吗?
There is a form on the website with "FTP username" and "FTP password" for administrators.
How to safely add the FTP user by PHP? Because currently we are connecting to the server via ssh - root - user, that's the worst solution. So for secondary solution we are added a normal user to the sudoers and enabled only a few commands for the user.
echo "testuser ALL=(ALL) NOPASSWD:/bin/mkdir,/bin/rmdir" > /etc/sudoers.d/testuser
But what about the useradd
command? if we allow that too for the normal user, it will not be safe too isn't it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论