Disable root login on Linux?

0

I setup a Linux server. I would like to maximize security on the server to reduce any security risks. I would like to disable login for the root account, and just add the regular user to the sudo/wheel group. How can I do that (disable login for root)?

thecomputerguru

Posted 2019-10-08T01:39:38.073

Reputation: 329

Which distro? Ubuntu is already setup like that. – None – 2019-10-08T02:19:25.613

CentOS. I basically want to have it setup similar to Ubuntu where root login is disabled. – thecomputerguru – 2019-10-08T03:00:43.730

2From passwd(5) on its -l switch: To disable the account, administrators should use usermod --expiredate 1 (this set the account's expire date to Jan 2, 1970). – Tom Yan – 2019-10-08T03:15:15.580

Is there a way to do it immediately? I am going to check that man page. – thecomputerguru – 2019-10-08T03:38:00.030

No answers