In this lab, I was asked to deny root login. The task was to edit the sshd_config file, set PermitRootLogin no, and then restart the sshd service.
I did this multiple times — edited the file, saved it, restarted, reloaded, even stopped and started the service. But when I tried logging in from the jump host using:
ssh root@stapp01
it still prompted me for a password.
This is confusing, because if PermitRootLogin no was applied, it shouldn’t even ask for a password — it should just deny the connection immediately. I can’t figure out why this setting isn’t taking effect.
problem is santosh , i wanted to apply it to one server and need to confirm that the configuration is applied to that server properly , lets assume if i disable the root loging in ‘stapp01’ after i logged from jump server , password for the root should not be prompted right ?
The behavior with PermitRootLogin is that, although it prompts for a password, it will eventually be denied if you set PassworkAuthentication to no. The prompt will not be shown, and you will get a denied message.