Disable root login on all app servers - failed

Hi Team,

I have disabled root login in /etc/passwd file. Please find attached image.
Is this not sufficient?

Hi,
You must manipulate the sshd_config file to do this so the root user can’t connect

Thanks Buddy, got it.

/etc/ssh/sshd_config
PermitRootLogin no

2 Likes

i did the same /sbin/nologin on all three app machines, but is shows task failed on app2 and app3 machine only (which means it succeded on app1) why is that?

Hi @DedeepyaDesineni

You need to make required changes in sshd_config file. changing shell to /sbin/nologin is incorrect as per requirements asked in the question.

For App 1 since you changed the root password itself which is bad to do since its not asked in the question so validation didn’t work for it at all.

1 Like

I have done the modification in /etc/ssh/sshd_config file with PermitRootLogin = no
still i got the same error . as Task failed please check
attached screen shoot

what i have made wrong i have done the same on all three app servers any help would be appriciated

@kumarpuvvadi
You missed to restart sshd service after making required changes hence tasks failed for you.

1 Like

@Inderpreet thanks for the correction.
I missed it. it will make me remember next time. :wink:

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