Disable root login task

I have disabled root login in all app servers, but failed. Dont know why

% sudo -i
#vi /etc/ssh/sshd_config
Uncoment : ##PermitRootLogin yes
replace with: PermitRootLogin no
# service sshd restart

1 Like

Open Three Terminal and ssh on all App server,

on Terminal one
ssh [email protected]  
on Terminal Two
ssh [email protected]
on Terminal three
ssh [email protected]
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


sudo systemctl restart sshd