TheGlenn88

Registered
Nov 9, 2013
3
0
1
cPanel Access Level
Root Administrator
Hi,

I have been trialling cPanel so far with success, one thing that i cannot for the life of me do is login to SSH using keys. Not only in cPanel i have never been able to do it via VPN in my router configuration. I have spent alot of time trying to do it but with no success.

I am using the latest cPanel 11.40.0 b19 (on a cloudlinux VM locally) and i am running os x 10.9 mavericks and using the terminal ssh client. Root user login is disabled, password auth is disabled, created a new user and included in wheel group.

I have tried:
Generating the key from WHM and importing it into my ~/.ssh folder and creating a config file inside with the host and username.

and
Generating the key from osx and importing the public key into WHM and authorising.

either way i just get the error "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)."

I have tried using

ssh <user>@host
ssh -i ~./ssh/id_rsa <user>@host
ssh -i ~./ssh/id_rsa host
ssh -i ~./ssh/private.key <user>@host (when imported from WHM)
ssh -i ~./ssh/private.key host (when imported from WHM)

Any help will be greatly appreciated.

Kind Regards
Mike
 

TheGlenn88

Registered
Nov 9, 2013
3
0
1
cPanel Access Level
Root Administrator
I managed to get this problem resolved.

Where i was going wrong was that i had created a new user and added it to wheel because root login is disabled. I was logged in to WHM as root and generating/importing the keys using the panel. which was creating keys for the user root instead of my newly created user...

so i logged in via ssh using password created the keys using "ssh-keygen -t dsa" then imported to my laptop.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,912
2,241
363
Hello :)

I am happy to hear you were able to resolve the issue. Thank you for sharing the solution with us.