Skip to main content

How to Access a cPanel Account through WHM

Comments

5 comments

  • cPanelTJ
    With root access, you'd simply call the cPanel UAPI functions on behalf of the users. This concept is usually referred to as "masquerading". It would look something like this over bash/CLI: uapi --user= Email add_pop email='user' password='123456luggage'
    Here is the full documentation on the API function: Create email address " cPanel & WHM Developer Portal
    0
  • jwhm
    I don't have root access, I am a Reseller. I can access the cURL API and that's it
    0
  • jwhm
    [CODE=php]$ch2 = curl_init( 'https://lima.example.io:2087/json-api/create_user_session?api.version=1&user=%40&service=cpaneld' ); curl_setopt($ch2, CURLOPT_HTTPHEADER, array( 'Authorization: cpanel', ': ' )); curl_setopt( $ch2, CURLOPT_RETURNTRANSFER, true ); $stack = curl_exec($ch2); curl_close($ch2);
    I have tried this, but it won't work any pointers? I was going to do this > Create a Session(from WHM token) > Use session to add email, domains etc
    0
  • jwhm
    Even
    0
  • jwhm
    Fixed. I have managed to create a cpsess for a cPanel account through WHM API using a Token. [CODE=php]/cpsess9617913732/json-api/cpanel?cpanel_jsonapi_user=&cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=Email&cpanel_jsonapi_func=addpop&domain=&email=example&password=eXample!10!
    However, upon using that cpsess to access Email Module, I keep getting 'Access Denied'.
    0

Please sign in to leave a comment.