Score:0

Failing SSH after disabling Root Login

dk flag

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?

cn flag
Where did you put the authorized key on the server? What user are you logging in as? what command used?
Raghav Gupta avatar
dk flag
@shearn89 I have put the public key of client under authorized_key file of server in directory - /root/.ssh . I am logging in as root user. What do you mean by what command used? You are asking for which command?
Score:5
it flag

Your behavior is completely normal. Change your PermitRootLogin no to a more conform to your needs PermitRootLogin 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.

Raghav Gupta avatar
dk flag
Tried this. After this, now when I am doing ssh from client it is asking for password. Why's that? Password shouldn't be asked when doing ssh.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.