Hi,
I am trying to chenge a cPanel account password using the WHM API command "passwd" described here; Update cPanel account password
Autenticated with API Token as 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'
, '<HOST_URL>:2087/json-api/passwd?api.version=1&password=<NEW_PASSWORD>&user=<ACCOUNT_USER_NAME>&db_pass_update=>0&enabledigest=0'
, [
Authorization => 'whm root:<WHM_API_TOKEN>'
, '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 “<ACCOUNT_USER_NAME>”.","output":{"raw":"Password for “<ACCOUNT_USER_NAME>” 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
I am trying to chenge a cPanel account password using the WHM API command "passwd" described here; Update cPanel account password
Autenticated with API Token as 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'
, '<HOST_URL>:2087/json-api/passwd?api.version=1&password=<NEW_PASSWORD>&user=<ACCOUNT_USER_NAME>&db_pass_update=>0&enabledigest=0'
, [
Authorization => 'whm root:<WHM_API_TOKEN>'
, '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 “<ACCOUNT_USER_NAME>”.","output":{"raw":"Password for “<ACCOUNT_USER_NAME>” 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
Last edited by a moderator: