Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

SSH::genkey as root user..

Discussion in 'cPanel Developers' started by Steven.C, Feb 7, 2013.

  1. Steven.C

    Steven.C Member

    Joined:
    Mar 24, 2008
    Messages:
    7
    Likes Received:
    0
    Trophy Points:
    51
    /json-api/cpanel?cpanel_jsonapi_user=root&cpanel_jsonapi_module=SSH&cpanel_jsonapi_func=genkey&cpanel_jsonapi_version=2&bits=2048&type=rsa&name=test&pass=XZY123

    produces error...

    Code:
    Internal Server Error
    
    Could not setuid to root at /usr/local/cpanel/Whostmgr/XMLUI/cPanel.pm line 82.
    
     at /usr/local/cpanel/Whostmgr/XMLUI/cPanel.pm line 82
    	Whostmgr::XMLUI::cPanel::cpanel_exec('HASH(0xc63390)', 'IO::Socket::SSL=GLOB(0xf1af120)', 1, 'HASH(0xf0f7b00)') called at cpsrvd-ssl line 5742
    	main::dodoc_whostmgrd() called at cpsrvd-ssl line 1489
    	main::dodoc('HASH(0xca30b0)') called at cpsrvd-ssl line 1214
    	main::handle_one_connection() called at cpsrvd-ssl line 875
    
    Doing so for any regular user works just fine. I may have been up too long to think, but the issue is not jumping out at me. Any assistance would be appreciated.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  2. cPanelJared

    cPanelJared Technical Analyst

    Joined:
    Feb 25, 2010
    Messages:
    1,835
    Likes Received:
    21
    Trophy Points:
    143
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    The problem is that you are effectively trying to log in and call a cPanel function as root. As you noted, it works when you use a cPanel account user, not as root. You would get the same error if you tried to log into a user's cPanel by entering "root" into the username field in the log-in box.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,569
    Likes Received:
    45
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    At this time we don't provide a remote API function to generate SSH keys for the root user.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice