The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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:
    1
    /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.
     
  2. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    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.
     
  3. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,458
    Likes Received:
    22
    Trophy Points:
    38
    cPanel Access Level:
    Root Administrator
    At this time we don't provide a remote API function to generate SSH keys for the root user.
     
Loading...

Share This Page