others-How to solve 'Permission denied (publickey,gssapi-keyex,gssapi-with-mic)'
1. The purpose of this post
I would demo how to solve this error when do ssh works in linux:
2. Environments
- Linux CentOS 7
3. Solution and commands
This error is caused by the misconfiguration of SSH service, it does not allow the password login, so the ssh-copy-id complains about the “permission denied(publickey,gssapi-keyex,gssapi-with-mic)”
How to solve it? Just enable the password authentication temporarily:
3.1 Open sshd_config
3.2 find the line
find this line: PasswordAuthentication no
change to: PasswordAuthentication yes
3.3 restart ssh service
3.4 retry the ssh command
Everything should be ok now.
3.5 disable the password authentication of SSH service
Just undo the changes in the /etc/ssh/sshd_config, then restart the SSH service again.