[Solved] SSH connection error – Permission denied (publickey,gssapi-keyex,gssapi-with-mic) cPanel server

SSH is the abbreviation for Secured Shell. SSH is a command-line program to login to remote Linux server which has SSH server. SSH is using for remote administration via server command line as root or any other user on that server who has ability to access the web-server via shell.  SSH (Secured Shell) is cryptographic protocol for remote server administration, data communication, remote command execution, and other secure network services between two networked computers. To connect machines by using SSH, the remote side must have a SSH server and also the client side must have SSH client to be installed.

In some strange situations, you may have trouble with SSH connection. If you are facing this error while accessing the server via SSH, here is the solution.

Error details:

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

Reason:

The password authentication was disabled on sshd_config file:

You can simply overcome this from your WHM control panel. Access your WHM control panel and do follow the steps below to overcome the SSH error.

Step I : Login to WHM
Step II : Go to,

WHM >> Security Center »SSH Password Authorization Tweak 

Then, enable the Password Auth. If it is already enabled, you may re-enable it to resolve the error.
ssh

Step III : Restart the sshd service.

That’s it 🙂

Related posts:
1, Important cPanel service’s configuration file, path, service name, port – Command line view
2, How to change cpanel port through command line
3, How to enable Varnish in cPanel server
4, How to check the version of your WHM/cPanel from command line ?

Arunlal Ashok

Linux Server Administrator. I'm dealing with Linux servers since 2012. I started this blog to share and discuss my ideas with the world. Check My Profile!! in uPwork (oDesk) and let me know if you need any assistance. Thanks!!

You may also like...

5 Responses

  1. hostme says:

    mate you saved my life..thank You!!!!!!!!!!!!!!!!!!!!!!!!!!!

  2. mehrdd says:

    Wow … thank you.. you saved me !

  3. Andre says:

    You saved me too ! Thank you so much.

  4. Kumar says:

    Hi Arun,

    I am receiving ‘permission denied (publickey gssapi-keyex gssapi-with-mic)’ issue. Would you be able to help me with resolving this issue please?

    Steps followed:
    as abc user issued ssh-keygen -t rsa -P “”
    from home directory as abc user, issued ‘cat /home/abc/.ssh/id_rsa.pub >> $HOME/.ssh/authorized_keys’ command
    from server6, issued ‘ssh-copy-id -i /home/abc/.ssh/id_rsa.pub [email protected] (abc01-01 is hostname) to copy the ssh public key
    Received ‘permission denied (publickey gssapi-keyex gssapi-with-mic)’ issue
    Steps followed to resolve permission denied error:
    mkdir /etc/ssh/
    cp /home/abc/.ssh/authorized_keys /etc/ssh/
    chown -R abc:abc /etc/ssh/
    chmod 755 /etc/ssh/<HOSTNAME?
    chmod 644 /etc/ssh//authorized_keys
    In /etc/ssh/sshd_config file ->
    ‘PubkeyAuthentication’ set to yes
    Uncomment ‘RSAAuthentication yes’
    Uncomment ‘AuthorizedKeysFile .ssh/authorized_keys’
    Uncomment ‘PasswordAuthentication yes’
    Uncomment ‘PasswordAuthentication yes’ (looks like two lines are same in this file)
    Uncomment ‘ChallengeResponseAuthentication no’
    Uncomment ‘ChallengeResponseAuthentication no’ (looks like two lines are same in this file)
    issue ‘service sshd reload’

Leave a Reply

Your email address will not be published. Required fields are marked *