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 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