1

I need to change passwords of FTP users with cPanel.php my cPanel is using pureftpd for creating FTP users, I want to implement change password for FTP user's.

The problem is pureftpd is creating virtual users in system and cPanel.php API manipulates users in server's /etc/passwd file.. will it be possible with cPanel API to change password of FTP user's created by pureftpd?

webDev
  • 135
  • 3
  • 13
  • This is the api's function for changing an FTP user's password. [Change FTP Password via Cpanel API](https://documentation.cpanel.net/display/SDK/UAPI+Functions+-+Ftp::passwd) – RightClick Apr 01 '15 at 16:18
  • You might have to change to creating and managing users all through the api, or find an api for pureftpd to change those values. – RightClick Apr 01 '15 at 16:19
  • @RightClick Can you please please tell me how can I use "cPanel or Webmail Session URL" I am not aware of how to use this API – webDev Apr 01 '15 at 16:30
  • there is a url based version of the api, and you can construct urls and then use curl to post the urls, which will perform an action and give a response. I find the url based version to be more difficult than the php class. The php class is very straightforward and has short calls that make sense to me, just include their file. You should read the beginner guide to learn how to make a call, then read the specifics of the ftp calls and apply that. – RightClick Apr 01 '15 at 16:40

1 Answers1

0

You can use the cPanel API2 to change password for FTP accounts from script:

Here is the code sample:

https://github.com/vthink/cpanel_api

Krishna
  • 27
  • 5