'What is the safe way to adding an FTP user through PHP?
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?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
