Hi, I'd like to know how I can add FTP users to cPanel with PHP. I know the function shell_exec() in PHP, but I don't know what Linux command I need to use to create FTP users. My home dir is /home/myusername/. Now I'd like that the added FTP user can only access it's own directory. For example I create testuser, then testuser must only be able to access /home/myusername/ftpaccounts/testuser/. There should also be an FTP quota for xxx MB. Any help appreciated! Thanks
it's unlikely that your hosting will allow you to directly execute the commands you require. The only alternative I can think of is to write a script that logs into cpanel, mimicing a browser.
I have written such a script. You can find it here: http://computersight.com/programming/php/cpanel-automation/
Very unlikely your host will give you access to the commands that create FTP accounts manually. cPanel PHP API Class: http://www.phpclasses.org/browse/package/3534.html DirectAdmin PHP API Class: http://www.directadmin.com/forum/showthread.php?t=258 I have used both these classes, both work great.