Friday, 22 November 2019

How to Resolve "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)" Error on CentOS 7



In most of cloud images, password authentication login method is disabled in Open SSH Configuration and can be logged in using SSH private key only. Following error messages will appear while coping ssh on remote server and also will get error when login on the server using password.

[root@linuxcnf ~]# ssh-copy-id user1@lc-node1
.....................
/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed
/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys
Permission denied (publickey,gssapi-keyex,gssapi-with-mic).
[root@linuxcnf ~]#

This article describes How to Resolve "Permission denied (publickey,gssapi-keyex,gssapi-with-mic)" on CentOS7

Step 1. Login on the remote server using authentication or console and edit the SSH configuration file /etc/ssh/sshd_config and change the "PasswordAuthentication no" to "PasswordAuthentication yes".

[root@lc-node1 ~]# vi /etc/ssh/sshd_config
……………….
PasswordAuthentication yes
……………….
[root@lc-node1 ~]#

Step 2. Restart the sshd service

[root@lc-node1 ~]# systemctl restart sshd
[root@lc-node1 ~]#

Step 3. Now try to login to verify the issue resolution.

4 comments:

  1. Still same issue.

    ReplyDelete
  2. Obrigado, ajudou muito, serve para o AlmaLinux também ou Ubuntu

    ReplyDelete
  3. Secure remote access, authentication methods, SSH key management, and server hardening are important aspects of protecting Linux and cloud infrastructures. Students interested in implementing secure communication protocols, authentication systems, and defense mechanisms can explore Network Security Projects for Final Year, where secure access control and protected network communication are key areas of research and development.

    ReplyDelete
  4. Secure authentication and controlled access are fundamental principles of protecting modern IT infrastructures from unauthorized access and data breaches. Technologies such as SSH key management, user authentication, privilege control, and secure remote administration are important topics in Information Security Projects, where students develop solutions to enhance data protection, access security, and the confidentiality of digital systems.

    ReplyDelete