Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

mahdy_sharifi

Well-Known Member
Feb 26, 2012
220
1
68
cPanel Access Level
Root Administrator
Hello :

I setup SSH key between 2 Cpanel server and can log between them with SSH pass through WHM .
But When I connect to server over SSH command line following error occur :

Permission denied (publickey,gssapi-keyex,gssapi-with-mic)

I google this problem too many question about this problem but not any right answer .

anybody know how can resolve ?

THanks
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Hello :)

Are you attempting to access SSH via a password or a SSH key? If with a key, check that the key is authorized via:

"WHM Home » Security Center » Manage root’s SSH Keys"

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
What command are you using for SSH access? Are you using a specific SSH client, and are you attempting to make the connection from your desktop or another server?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
You will need to ensure that you call the SSH key directly. EX:

Code:
ssh -i /path/to/id_rsa [email protected]
Also, make sure the authorized private key is imported to the server you are making the SSH connection from.

Thank you.
 

mahdy_sharifi

Well-Known Member
Feb 26, 2012
220
1
68
cPanel Access Level
Root Administrator
[email protected] [~/.ssh]# ssh -i /root/.ssh/server6 [email protected]
Warning: Identity file /root/.ssh/server6 not accessible: No such file or directory.
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).



[email protected] [~/.ssh]# ssh -i /root/.ssh/server6.pub [email protected]
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/root/.ssh/server6.pub' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /root/.ssh/server6.pub
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,261
463
Private key files should have 0600 permissions, whereas public key files can have 0644 permissions. Please ensure you have authorized the public key file on the destination server that you are attempting to access via SSH.

Thank you.