Can't add SSH private keys to CloudMin

14 posts / 0 new
Last post
#1 Thu, 05/09/2013 - 04:57
SoftDux

Can't add SSH private keys to CloudMin

I am trying to import a RSA Private Key into Cloudmin but it keeps rejecting the private key with the following error:

Failed to save SSH key : Pasted text does not appear to be an SSH key

Call Stack Trace

File Line Function
/usr/libexec/webmin/server-manager/save_key.cgi 71 WebminCore::error
(eval 43) 6 (eval)
/usr/libexec/webmin/miniserv.pl 2333 (eval)
/usr/libexec/webmin/miniserv.pl 917 miniserv::handle_request

I login to CloudMin, click on "CloudMin Settings" > "SSH Keys" > "Add SSH Key" > select "Pasted into textbox below.." and paste the key in

This is what they key looks like:

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,E043B2E7D5123910

omKJCjWytDNk4mNnHFQ4bjzWNJjssZFbMp4lCSnc4r5sDBYa/Zv3vOepEdRFkG/o

..................... snip .....................

8D4eZ76Aj0Fte++Cs+AGfnGLkUpBi5y3onTWPdRTHIN+Ednbi8qbMykgLc/2gf3y
-----END RSA PRIVATE KEY-----
Thu, 05/09/2013 - 08:02
andreychek

Howdy,

I believe it's looking for a public key in that particular screen, rather than a private key.

-Eric

Thu, 05/09/2013 - 15:32
SoftDux

Hi Eric,

I actually tried both a Private Key and Public Key and get the same error.

The Public Key I'm using looks as follows:

ssh-rsa AAAAB3Nz

------------------- snip -------------------
42uUqrS3jjMIu5h0BP9xGexOU= root@x.x.x.x

Wed, 10/23/2013 - 08:51
SoftDux

Can someone please tell me when this will be resolved? I still can't add Public SSH Keys from a cPanel server to CloudMin, to allow CloudMin to manage (i.e add / remove Network Interfaces, memory, view bandwidth usage, etc) a cPanel server which uses SSH Keys to CloudMin

Wed, 10/23/2013 - 20:37
andreychek

Well, we haven't been able to reproduce the issue you're seeing -- adding a public SSH key normally works without a problem.

Can you share the full public SSH key that you're trying to paste in?

-Eric

Tue, 10/29/2013 - 23:30
Joe
Joe's picture

This form may be wanting an ascii armored version, perhaps? I'm not sure. When copy/pasting, the client can do weird things with more complex data. Browsers may choose different encodings, etc.

It's kinda bug-like that you're getting a traceback, anyway. I'll ask Jamie to have a look at this thread.

--

Check out the forum guidelines!

Tue, 10/29/2013 - 23:34
JamieCameron

I think the issue is the lines :

Proc-Type: 4,ENCRYPTED
DEK-Info: DES-EDE3-CBC,E043B2E7D5123910

at the start of your public key. Try removing those from the text box, and see if Cloudmin accepts it.

''

Mon, 01/06/2014 - 22:45 (Reply to #7)
mlbarrow

I ran into this problem as well using Cloudmin GPL (7.4.kvm) and removing those lines did not work for me.

I looked at the code (server-manager-lib-funcs.pl, check_ssh_key_data) and it looks like the issue is the regexp back match: $3 should be $4. I made the patch to my local copy and I can now add a private key properly via upload or pasting it in.

But there seems to be a larger issue here. It appears that the first key generated MUST either be generated by Cloudmin or be a private key. Once one gets over that hurdle, one can add public keys that get added to newly-created VMs (which was my original intent). Is that a bug in the code, UI, or an issue with my understanding?

Mon, 01/06/2014 - 23:30 (Reply to #8)
JamieCameron

Thanks for pointing out this bug - I'll include your fix in the next release.

Cloudmin needs a private key when creating a new VM so that it can SSH into the system.

''

Tue, 01/07/2014 - 16:10 (Reply to #9)
mlbarrow

I'm glad that my edit was helpful. After I posted, I played around with things a bit more and better understand the use case. There seems to be something else awry here. In my case, I merely wanted to add a public SSH key that would be installed for root of the new machine.

It seems that if no SSH keys are defined, the code defaults to insisting that the first key be a private/public key pair. What I did to work around this was generate a keypair using the first option, but I am not using that key pair for the VM creation. I have it generating random root passwords. After I created this first key, I can go ahead and add in a public key to be included in roots authorized_keys file.

Is this behavior a bug? Or is it just a case of the UI/help needing to make this more clear. I'm happy to volunteer a fix in either case; just let me know your preference.

Tue, 01/07/2014 - 20:05 (Reply to #10)
JamieCameron

That could be a bug. What error message were you getting when the first key isn't a public/private key pair?

''

Tue, 01/07/2014 - 22:00 (Reply to #11)
mlbarrow

Instead of flapping my arms or using sock puppets, I made a screen recording so you could see. Link is here: https://dl.dropboxusercontent.com/u/4292545/cloudmin-ssh-keys.m4v

Tue, 01/07/2014 - 22:27 (Reply to #12)
JamieCameron

Ok, I see the bug that causes this now - a fix will be included in the next Cloudmin release.

''

Wed, 01/08/2014 - 21:26 (Reply to #13)
mlbarrow

Great! I didn't even have to write any code! :-)

Topic locked