Mobile app version of vmapp.org
Login or Join
Gonzalez347

: 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

@Gonzalez347

Posted in: #Cpanel #Ftp #Php

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?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Gonzalez347

1 Comments

Sorted by latest first Latest Oldest Best

 

@Ogunnowo487

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme