Coding⏱️ 3 min read📅 2026-06-15

How to Fix: git with ssh error: Permission denied (publickey,keyboard-interactive)

Git SSH error Permission denied (publickey,keyboard-interactive) on Windows server with CentOS client

Quick Answer: Check the permissions of the authorized_keys file and ensure that the public key is correctly added to the server. Run `chmod 700 ~/.ssh/authorized_keys` and then try again.

The error 'Permission denied (publickey,keyboard-interactive)' occurs when the SSH client cannot authenticate with the server using the public key provided. This issue affects users who have generated a public-private key pair and are trying to connect to an SSH server using that key.

This error can be frustrating because it prevents users from accessing remote servers or performing tasks that require SSH authentication. However, by following the steps outlined in this troubleshooting guide, you should be able to resolve the issue and regain access to your remote server.

🔍 Why This Happens

  • The primary reason for this error is that the SSH server is not configured to accept public key authentication. This can happen if the SSH server is not properly set up or if there are issues with the configuration files.
  • Another possible cause is that the public key provided by the client is incorrect or not recognized by the SSH server. This can occur if the key was generated incorrectly or if it has been corrupted during transfer.

✅ Best Solutions to Fix It

Configuring SSH Server to Accept Public Key Authentication

  1. Step 1: Step 1: Check the SSH server configuration files to ensure that public key authentication is enabled. The default configuration file for OpenSSH on Windows is usually located at C:\Program Files\OpenSSH\etc\ssh/sshd_config.
  2. Step 2: Step 2: Add the following lines to the sshd_config file to enable public key authentication: PubkeyAuthentication yes and AllowPublicKeyAuthentication yes. Save the changes and restart the SSH service.
  3. Step 3: Step 3: Verify that the SSH server is accepting public key authentication by checking the log files for any error messages related to authentication.

Verifying Public Key Authentication

  1. Step 1: Step 1: Check the permissions of the authorized_keys file on the remote server to ensure that it is owned by the correct user and has the correct permissions. The default permissions for authorized_keys are usually -rw-r--r--.
  2. Step 2: Step 2: Verify that the public key provided by the client is correctly formatted and not corrupted during transfer. You can use tools like ssh-keygen -v to verify the integrity of the key.

💡 Conclusion

To resolve the 'Permission denied (publickey,keyboard-interactive)' error, you need to configure your SSH server to accept public key authentication and verify that the public key provided by the client is correctly formatted. By following the steps outlined in this guide, you should be able to resolve the issue and regain access to your remote server.

Did this fix your problem?

If not, try searching for specific error codes.

🔍 Search Error Database

❓ Frequently Asked Questions