After generating the private and public key for a RHEL Client and storing the public key in the authorized_keys folder of the RHEL 7 Server, I disabled the Root Login in the Server by going to /etc/ssh/sshd_config
and setting PermitRootLogin to no. After that I restarted the sshd service.
Now when I am trying to do ssh from client to server it says
Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password)
Why I am getting this message?
Your behavior is completely normal. Change your
PermitRootLogin no
to a more conform to your needsPermitRootLogin without-password
Be sure to have the right key at the right place (usually ~/.ssh/authorized_keys) with the good owner:group, and with the chmod 600 and 700 on ~/.ssh/authorized_keys and ~/.ssh.