I am currently working on creating a member system for my FTP server for close friends that I want to have access to the server, however the FTP server I use (proFTPd) uses Linux users as each member account, therefore I need to use an html form with php, of course, which will have access to the server and be able to create a user on the system.
Now I have a form that is fully customizable with its validating username / username / password and storing it in my sql database. The only thing I am missing is to create a new user to finish it.
I know that this is not always the safest thing, but I really want to do this, and I know the dangers, so any help would be nice ...
As of now, from what I always used to create a user on linux (or my version of Ubuntu atleast), this is:
useradd [username] -p [password] -d [/path_to_home_directory] -s [/bin/false]
without brackets, of course.
I also know php commands: shell_exec, exec, system () However, I tried each of them with a line to create a user in it, and nothing works.
I did a bit more research and noticed that the web server is running on www-data (what it should be) and it does not have access to the useradd command. Therefore, I "viduso" him and still have not changed.
From what I saw, I can provide access to www data to the script on the server, which then creates the user as root, but I do not know how to transfer the variables stored in php to the script.
If you need more information to help just ask. This is the last thing I need to complete my last 2-month project, which includes a desktop application and all that. It is so close, but I cannot understand it.