Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 24
  1. #1
    Member
    Join Date
    Mar 2011
    Posts
    9

    Default [Case 47947] Can't create SSH Keys on cPanel User

    I have a cPanel user, I just created on my new cPanel installation..

    But when I try to Import an SSH Public RSA Key I get this:
    Code:
    The key named was imported.
    
    [a fatal error or timeout occurred while processing this directive] Invalid filename

    I took a look in /usr/local/cpanel/logs/error_log I noticed this:
    Code:
    [2011-03-11 18:50:46 +0000] warn [ssh::listkeys] Encountered error in ssh::listkeys: Invalid filename
    [2011-03-11 18:50:46 +0000] warn [ssh::listkeys] Encountered error in ssh::listkeys: Invalid filename
    [2011-03-11 18:51:20 +0000] die [Internal Death while parsing ./frontend/x3/telnet/keys/import.html 26244] Can't locate object method "new" via package "FileHandle" (perhaps you forgot to load "FileHandle"?) at /usr/local/cpanel/Cpanel/FileUtils.pm line 171.
    	Cpanel::FileUtils::writefile('/home/ts3/.ssh/id_rsa.pub', 'ssh-rsa <removed key>...') called at /usr/local/cpanel/Cpanel/SSH.pm line 1040
    	Cpanel::SSH::_importkey('passphrase', undef, 'user', 'ts3', 'name', 'id_rsa.pub', 'key', 'ssh-rsa <removed key>...') called at /usr/local/cpanel/Cpanel/SSH.pm line 1076
    	Cpanel::SSH::api2_importkey('key', 'ssh-rsa <removed key>...', 'name', 'id_rsa.pub') called at (eval 82) line 1
    	eval '$dataref = [Cpanel::SSH::api2_importkey(%{$rCFG})];' called at /usr/local/cpanel/Cpanel/Api2/Exec.pm line 84
    	Cpanel::Api2::Exec::api2_exec('SSH', 'importkey', 'HASH(0x26b6af0)', 'HASH(0x17ed620)') called at cpanel line 607
    	main::real_cpexectag('<?cp SSH::importkey($LANG{\'SSHKeyImportText1\'} % $LANG{\'SSHKe...') called at cpanel line 3879
    	main::dotag_finished_headers(0) called at cpanel line 3704
    	main::cpanel_parseblock('<cpanel setvar="headerimg=../../images/topmysql.gif">^J<cpanel se...') called at cpanel line 3612
    	main::cpanel_parse('GLOB(0x22afa70)') called at cpanel line 5121
    	main::run_standard_mode() called at cpanel line 424
    
    
    [2011-03-11 18:51:20 +0000] warn [cpanel] Unable to run [Cpanel::SSH::api2_importkey(2/8)]; Bad file descriptor at /usr/local/cpanel/Cpanel/Api2/Exec.pm line 90
    	Cpanel::Api2::Exec::api2_exec('SSH', 'importkey', HASH(0x26b6af0), HASH(0x17ed620)) called at cpanel line 607
    	main::real_cpexectag('<?cp SSH::importkey($LANG{\'SSHKeyImportText1\'} % $LANG{\'SSHKeyImportText2\'},name) name=$FORM{\'keyname\'}.pub,key=$FORM{\'pubkey\'} ?>') called at cpanel line 3879
    	main::dotag_finished_headers(0) called at cpanel line 3704
    	main::cpanel_parseblock('<cpanel setvar="headerimg=../../images/topmysql.gif">\x0A<cpanel setvar="dprefix=../../">\x0A<cpanel Branding="include(stdheader.html)">\x0A\x0A<style type="text/css">\x0A<?cp Branding::spritelist(.spriteicon_img_mini {float:left;margin-right:5px;background: url\\{leftparenthesis}%\\{rightparenthesis};} %,spriteurl,images::#icon-${img}_mini {background-position\\{colon}0 -${cssposition}px;width\\{colon}${width}px;height\\{colon}${height}px; }:) imgtype=icon,subtype=img,method=scale_60percent,format=png,img=ssh-shell-access ?>\x0A\x0A</style>\x0A<div class="body-content">\x09<div class="h1Title"><div class="spriteicon_img_mini" id="icon-ssh-shell-access_mini"></div><cpanel langprint="SSHImportKey"></div>\x0A\x0A<p>\x0A<?cp SSH::importkey($LANG{\'SSHKeyImportText1\'} % $LANG{\'SSHKeyImportText2\'},name) name=$FORM{\'keyname\'},key=$FORM{\'privkey\'} ?>\x0A<cpanelif $CPERROR{\'ssh\'}>\x0A    <cpanel print="$CPERROR{\'ssh\'}">\x0A</cpanelif>\x0A<?cp SSH::importkey($LANG{\'SSHKeyImportText1\'} % $LANG{\'SSHKeyImportText2\'},name) name=$FORM{\'keyname\'}.pub,key=$FORM{\'pubkey\'} ?>\x0A\x0A<cpanelif $CPERROR{\'ssh\'}>\x0A    <cpanel print="$CPERROR{\'ssh\'}">\x0A</cpanelif>\x0A\x0A</p>\x0A \x0A<div class="return-link"><a href="index.html">&larr; <cpanel langprint="SSHBack"></a></div>\x0A</div>\x0A<cpanel Branding="include(stdfooter.html)">\x0A') called at cpanel line 3612
    	main::cpanel_parse(GLOB(0x22afa70)) called at cpanel line 5121
    	main::run_standard_mode() called at cpanel line 424
    [2011-03-11 18:51:20 +0000] warn [ssh::importkey] Encountered error in ssh::importkey: Invalid filename
    [2011-03-11 18:52:52 +0000] warn [ssh::listkeys] Encountered error in ssh::listkeys: Invalid filename
    [2011-03-11 18:52:52 +0000] warn [ssh::listkeys] Encountered error in ssh::listkeys: Invalid filename

    Any help with this issue would be greatly appreciated.. I've been trying to find a solution for a while now, and no luck


    Cheers,

    Chris
    Last edited by chrislog; 03-11-2011 at 01:35 PM.

  2. #2
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    Hello Chris,

    Please provide the exact steps being used for importing the key. Also, can you confirm the key itself was correctly generated? Was cPanel used to generate the key or some other system?

    Thanks.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  3. #3
    Member
    Join Date
    Mar 2011
    Posts
    9

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    Quote Originally Posted by cPanelTristan View Post
    Hello Chris,

    Please provide the exact steps being used for importing the key. Also, can you confirm the key itself was correctly generated? Was cPanel used to generate the key or some other system?

    Thanks.
    Hey, I do the following:
    Login in to cPanel > Security: SSH/Shell Access > Manage SSH Keys > Import Key > Enter the filename: id_rsa > Enter the Public Key > Import > Then the error appears.

    The Key works on another one of my servers, which is using WHM/cPanel and imports without any issues.
    I am in the process of setting up another server and decomissioning the old one, so the Installation I am having an issue with adding SSH Keys with is on a 45-Day Trial License, but my license will be transferred over once I'm finished setting up the new server..

    Also the SSH Key was generated using PuTTY Key Generator. I use this key for a few other things too and never had any issues.

    Hope this helps,

    Cheers

    Chris

    So far this has been a troublesome task

  4. #4
    Member
    Join Date
    Mar 2011
    Posts
    9

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    Posted a quick reply, but I think it needs approved?

    Did the reply go through? o.O

  5. #5
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    The reply appears for me because I have access to approve moderated posts. I removed the key you'd pasted because it's a security risk to post it.

    Next, don't put a name for the key. Finally, are you certain you are pasting the public key? The public key normally ends in .pub, so I'm thinking it might be the private key you are pasting into the box.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  6. #6
    Member
    Join Date
    Mar 2011
    Posts
    9

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    Quote Originally Posted by cPanelTristan View Post
    The reply appears for me because I have access to approve moderated posts. I removed the key you'd pasted because it's a security risk to post it.

    Next, don't put a name for the key. Finally, are you certain you are pasting the public key? The public key normally ends in .pub, so I'm thinking it might be the private key you are pasting into the box.
    PuTTY Key Gen displays it in an SSH line format for copying pasting, it states its the Public key, which is the one I am copying over, I've never had this issue with it before



    I also get the same error when not specifying a filename:
    "The key named was imported.

    [a fatal error or timeout occurred while processing this directive] Invalid filename"

    Edit: Any key I try to import does not work, if that helps
    Last edited by chrislog; 03-11-2011 at 01:26 PM.

  7. #7
    Registered User
    Join Date
    Dec 2010
    Posts
    2

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    Hi, I just started having this problem today as well, I think this last update might have messed something up. I use this part of cpanel frequently and only today I ran into this problem.

    When i click on [a fatal... I get this :

    Can't locate object method "new" via package "FileHandle" (perhaps you forgot to load "FileHandle"?) at /usr/local/cpanel/Cpanel/FileUtils.pm line 171.
    Cpanel::FileUtils::writefile('/home/.ssh/lxxxxxx.pub', 'ssh-rsa AAAAB3Nxxxxxxxxx...') called at /usr/local/cpanel/Cpanel/SSH.pm line 1040
    Cpanel::SSH::_importkey('passphrase', undef, 'user', 'lxxxxx', 'nxxx', 'cxxxxx.pub', 'key', 'ssh-rsa AAxxxxxx...') called at /usr/local/cpanel/Cpanel/SSH.pm line 1076
    Cpanel::SSH::api2_importkey('key', 'ssh-rsa AAxxxxxxx...', 'name', 'cxxxx.pub') called at (eval 82) line 1
    eval '$dataref = [Cpanel::SSH::api2_importkey(%{$rCFG})];' called at /usr/local/cpanel/Cpanel/Api2/Exec.pm line 84
    Cpanel::Api2::Exec::api2_exec('SSH', 'importkey', 'HASH(0x10fe5bd0)', 'HASH(0x17ed620)') called at cpanel line 607
    main::real_cpexectag('<?cp SSH::importkey($LANG{\'SSHKeyImportText1\'} % $LANG{\'SSHKe...') called at cpanel line 3879
    main::dotag_finished_headers(0) called at cpanel line 3704
    main::cpanel_parseblock('<cpanel setvar="headerimg=../../images/topmysql.gif">^J<cpanel se...') called at cpanel line 3612
    main::cpanel_parse('GLOB(0x10bdb920)') called at cpanel line 5121
    main::run_standard_mode() called at cpanel line 424
    Last edited by uKontrol; 03-11-2011 at 01:39 PM. Reason: Add error msg

  8. #8
    Member
    Join Date
    Mar 2011
    Posts
    9

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    I also get a similar error when clicking "[a fatal..."

    SSH-Key Removed where stated by <KEY REMOVED>

    Code:
    Can't locate object method "new" via package "FileHandle" (perhaps you forgot to load "FileHandle"?) at /usr/local/cpanel/Cpanel/FileUtils.pm line 171.
    	Cpanel::FileUtils::writefile('/home/ts3/.ssh/id_dsa.pub', 'ssh-rsa <KEY REMOVED>...') called at /usr/local/cpanel/Cpanel/SSH.pm line 1040
    	Cpanel::SSH::_importkey('passphrase', undef, 'user', 'ts3', 'name', 'id_dsa.pub', 'key', 'ssh-rsa <KEY REMOVED>...') called at /usr/local/cpanel/Cpanel/SSH.pm line 1076
    	Cpanel::SSH::api2_importkey('key', 'ssh-rsa <KEY REMOVED>...', 'name', '.pub') called at (eval 82) line 1
    	eval '$dataref = [Cpanel::SSH::api2_importkey(%{$rCFG})];' called at /usr/local/cpanel/Cpanel/Api2/Exec.pm line 84
    	Cpanel::Api2::Exec::api2_exec('SSH', 'importkey', 'HASH(0x2c65930)', 'HASH(0x17ed620)') called at cpanel line 607
    	main::real_cpexectag('<?cp SSH::importkey($LANG{\'SSHKeyImportText1\'} % $LANG{\'SSHKe...') called at cpanel line 3879
    	main::dotag_finished_headers(0) called at cpanel line 3704
    	main::cpanel_parseblock('<cpanel setvar="headerimg=../../images/topmysql.gif">^J<cpanel se...') called at cpanel line 3612
    	main::cpanel_parse('GLOB(0x285c9c0)') called at cpanel line 5121
    	main::run_standard_mode() called at cpanel line 424
    Last edited by chrislog; 03-11-2011 at 01:52 PM.

  9. #9
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    Can you both please post your cPanel version numbers?

    Code:
    cat /usr/local/cpanel/version
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  10. #10
    Member
    Join Date
    Mar 2011
    Posts
    9

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    Using this version:

    11.28.86-RELEASE_51183

  11. #11
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    I'm going to be testing this now to see the results. I'm generating an SSH-2 RSA key using puttygen in Windows, then going to try to import that key into WHM on that version of cPanel. I'll get back once I have the results. We may need to have you both open up a ticket regardless.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  12. #12
    cPanel Staff cPanelTristan's Avatar
    Join Date
    Oct 2010
    Location
    somewhere over the rainbow
    Posts
    6,305
    cPanel/Enkompass Access Level

    Root Administrator

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    While I am getting invalid filename, the key itself does not show any fatal errors and it does show up on the list. Here's the message when I try to import it:

    The key named was imported.The key named rsa-key-20110311.pub was imported.Invalid filename
    It also does let me authorize it. Please open up a ticket for us to check into this further using WHM > Support Center > Contact cPanel or via the link in my signature. Please post the ticket number here once the ticket has been opened. Please note that you might want to try a forced cPanel update prior to opening the ticket:

    Code:
    /scripts/upcp --force
    Of note, I tested this on both 11.28.86-RELEASE_51183 and 11.28.86-CURRENT_51183 machines. I used puttygen to generate an SSH-2 RSA key on a Windows XP box.
    cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
    -- Tristan, Forums Technical Analyst, cPanel Tech Support

    Submit a ticket | Check an existing ticket

  13. #13
    Member
    Join Date
    Mar 2011
    Posts
    9

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    Tried the forced update, but it did not change my problem.

    I submitted the ticket as requested, the Ticket ID is: 1277149

    Thanks for your help, I really appreciate it!

    Cheers

    Chris

  14. #14
    Member
    Join Date
    Mar 2011
    Posts
    9

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    I forgot to mention, the License on that server is just a Trial, at the moment, since I'm transferring stuff from an old server to this one. If you need the support number from the other cpanel (licensed one) then I can give you that.

  15. #15
    Registered User
    Join Date
    Dec 2010
    Posts
    2

    Default re: [Case 47947] Can't create SSH Keys on cPanel User

    I followed your steps above:


    Code:
    Checked 1 files for 2 user(s), 1 ok, 0 broken
    ...Done
    root@xxxxx [~]# cat /usr/local/cpanel/version
    11.28.86-RELEASE_51183root@xxxxxx [~]#
    And using PuttyGen on Windows XP still reproduced the error.

    Support Request Id 1277530

    Thank you

Similar Threads & Tags
Similar threads

  1. Question on SSH Keys for cPanel users.
    By Acenet Andyb in forum cPanel and WHM Discussions
    Replies: 14
    Last Post: 04-13-2011, 04:39 PM
  2. Cpanel SSH Keys - defect function?
    By khorinis in forum New User Questions
    Replies: 7
    Last Post: 10-19-2010, 11:58 PM
  3. How to connect in SSH after create key in Manage SSH Keys
    By konrath in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 07-03-2009, 10:57 PM
  4. Create SSH Keys and login using putty - access denied
    By isputra in forum cPanel and WHM Discussions
    Replies: 8
    Last Post: 05-05-2008, 09:34 PM
  5. ssh keys on cPanel server
    By sh4ka in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 07-19-2006, 05:46 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube