WHM API1 Account password change fails
Hi,
I am trying to chenge a cPanel account password using the WHM API command "passwd" described here; API Tokens in WHM
This are the relevant parts of my code:
-------------------------------------------------
#/usr/bin/perl
use strict;
use warnings;
use LWP::UserAgent;
use LWP::Protocol::https;
my $ua = LWP::UserAgent->new(timeout => 30, ssl_opts => { verify_hostname => 0, SSL_verify_mode => 'SSL_VERIFY_NONE', SSL_use_cert => 0 });
my $req= HTTP::Request->new(
'GET'
, ':2087/json-api/passwd?api.version=1&password=&user=&db_pass_update=>0&enabledigest=0'
, [
Authorization => 'whm root:'
, 'Accept-Encoding' => 'gzip, deflate'
]
);
my $RES = my $ua->request($req)
my $STR = $RES->decoded_content;
---------------------------------------------
When run i receive the server response:
---------------------------------------------
{"data":{"app":["system","ftp","mail","postgresql">},"metadata":{"command":"passwd","reason":"Password changed for user "".","output":{"raw":"Password for "" has been changed.FTP (File Transfer Protocol) password change has been queued.\n"},"result":1,"version":1}}
---------------------------------------------
But the new password don't work, i can't loggin to the account.
I apprecaite help.
Welcho
-
Hey there! I'm wondering if the server's task queue isn't processing quickly enough and leading to a delay in the FTP password change. If you check WHM >> Task Queue Monitor do you see processing lingering there? If not, does running /scripts/ftpupdate get the password working after you run that command? 0 -
Hi cPRex, thanks for your reply. When run API, in the Task Queue monitor i only see this two tasks: But they disappear a few seconds after. I belive the number 2 is ftpupdate. Welcho 0 -
So even after the ftpupdate command runs, the password still doesn't work when you try and log in as the user? If that's the case, could you submit at ticket to our team so we can test this on your machine? I'm not seeing any obvious failures that would indicate why this isn't working. 0 -
So even after the ftpupdate command runs, the password still doesn't work when you try and log in as the user? If that's the case, could you submit at ticket to our team so we can test this on your machine? I'm not seeing any obvious failures that would indicate why this isn't working.
I will send a submit the support ticket.0 -
If you can post the number once you have it so I can follow along that would be great! 0 -
If you can post the number once you have it so I can follow along that would be great!
Thanks, The ticket ID is 950670310 -
I found the problem... URL encoding for the sent parameters solve the problem. The only thing I think is bad is that de response was a confirmation of change when it was not. 0 -
I'm glad you were able to find a solution! 0
Please sign in to leave a comment.
Comments
8 comments