: Enabling/disabling proftpd accounts with PHP and WHM I have a VPS with WHM/CPanel which is being used just by me. It's utilizing proftpd. I'd like to, via a PHP script, disable/enable a
I have a VPS with WHM/CPanel which is being used just by me. It's utilizing proftpd. I'd like to, via a PHP script, disable/enable a specific FTP account. I've done this by having PHP call a bash script which removes/adds the user account line to /etc/proftpd/USERNAME password file. However, in order to do this I have to give other write rights to /etc/proftpd/USERNAME. This isn't ideal, and I'd be willing to do it another way. It also seems like WHM is automatically resetting these permissions on a regular basis. Does anybody have any ideas on a better way to deal with this?
More posts by @Gonzalez347
1 Comments
Sorted by latest first Latest Oldest Best
That's how file permissions work. If you want a user/group to have access to a file, then they need the permission to do it. If you don't want your PHP/Apache user to have access to that file, then you can't use PHP to do the enabling/disabling.
You could, however, create a separate user to run PHP as for this admin panel. This way the PHP admin panel is able to enable/disable FTP accounts, but your other PHP users won't have access to the file. One way to do this is through suEXEC.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.