Fixed: permission denied publickey gssapi keyex gssapi with mic

Fix: permission denied publickey gssapi keyex gssapi with mic

After changing permission-related settings on the SSH server, the SSH Permission denied error appears. Typical scenarios include the installation of a new package or the creation of new users. In this article, you will learn how to troubleshoot the SSH Permission denied error and reconnect to your SSH server.


  • The local machine has an SSH client, and the remote system has an SSH server.
  • A user account to connect to a remote server (for password-based login)
  • A user account with sudo or root access.

What is Causing SSH Permission Denied (publickey,gssapi-keyex,gssapi-with-mic)?

When attempting to SSH into a server, the following error occurs:

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

Following the Permission denied statement, the bracket contains the failed authentication methods used during connection setup. The error implies that the problem is with the public key, which is false. The file containing SSH server configuration, sshd_config, could be one cause of the error. Another possibility is that the permissions on the authorized keys file are insufficient. This file contains a list of public keys for clients who are permitted to SSH into the server. As a result of the system’s inability to read from the file, the Permission denied error occurs.

How to fix SSH Permission denied

Both solutions contain steps you need to perform on the server-side. Start by opening the terminal on your server and proceed with one of the solutions below.

Solution 1: Enable Password Authentication

One of the solutions for fixing the Permission denied error is to enable password login in is the sshd_config file.

1. Open the sshd_config file in a text editor.

sudo nano /etc/ssh/sshd_config

2. Find the PasswordAuthentication line and make sure it ends with yes.

3. Find the ChallengeResponseAuthentication option and disable it by adding no at the end of the line.

Note: If these lines are commented out, remove the hash sign # to uncomment them.

4. Save the file using CTRL + O and CTRL + X to exit.

Now restart the SSH server by typing the following command:

sudo systemctl restart sshd


This is you can fix permission denied publickey gssapi keyex gssapi with mic error. Do you share this article with your friends and family members keep visiting for more awesome content

Posted by
Devender Gupta

Founder & Editor-in-chief of Gizmoxo - Entrepreneur, Youtuber, Reviewer, Traveler