How to disable root login on console on debian and cent os 6. I have tried truncating /etc/securetty but it will disable all the users. I want to disable only root login through console.
1) Activate the pam_access module on /etc/pam.d/login adding on the first 'account' line --> "account required pam_access.so"
2) Configure the access on /etc/security/access.conf :
3) +:root:cron crond [To avoid " pam_access(crond:account): access denied for user
root' fromcron'" and "crontab: pam_access(crond:account): access denied for user
This will disable the root account on debian (not sure about cent os):
sudo passwd -l root
You could also edit the
/etc/passwd file. Change the
/bin/bash at the end of the "