Task - Disable root login

Hello Team.,

Firstly thanks for setting up this excellent learning, practice and testing resource.
Coming to my issue, I got this task to disable root login. I used the simple option of disabling the root user’s shell by changing it to /sbin/nologin on all 3 servers. But i got a failed result giving the reason that sshd_config was not updated on stapp01. I guess it was expecting root logins from ssh based logins to be disabled through sshd_confg.
While the sshd option may be better, but disabling the root user shell also accomplished the objective stated in the task in my view. Just thought of checking with you.


Best regards,
Prashanta

Yea, problem with changing shell is if we SSH using any sudo user and try to switch to root it won’t work either. But in the question it is asked to disable direct SSH login only.

OH. OK. Thanks. I guess i missed the ssh requirement.

Best regards,
Prashanta

Open Three Terminal and ssh on all App server.

on Terminal one
ssh tony@stapp01  
on Terminal Two
ssh steve@stapp02
on Terminal three
ssh banner@stapp03
Run the below command on each app server and Search for #PermitRootLogin yes
sudo vi /etc/ssh/sshd_config
Remove the “#” and change “yes” to “no” according to image

image

sudo systemctl restart sshd

Hello, @Uppalapati
I request you please don’t share complete steps. Let them do try first.

Regards,