Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 11-18-2011, 03:58 PM   #1
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 879

Rep: Reputation: 113Reputation: 113
Preventing root login

I was wondering what is the best way to disable the root account on centOS 5.7 32bit?

usermod -L root # this is what I would prefer but will it work on root account??
echo > /etc/securetty # This would work but if I wanted to reenable it I would have to recreate this file.
Is there any other recommend way? I disabled it via sshd_config as well.

If you ask why I want to completely disable root its because I don't need it with sudo and even though I disabled the login via sshd_config I can still go root with
and it still allows me to login.


Last edited by jmc1987; 11-18-2011 at 04:22 PM.
Old 11-18-2011, 04:15 PM   #2
Registered: Mar 2010
Distribution: Arch
Posts: 211

Rep: Reputation: 67
The pretty way is `sudo usermod -L root`.
1 members found this post helpful.
Old 11-18-2011, 04:22 PM   #3
Registered: Sep 2009
Location: Oklahoma
Distribution: Debian, CentOS, windows 7/10
Posts: 879

Original Poster
Rep: Reputation: 113Reputation: 113
Originally Posted by jthill View Post
The pretty way is `sudo usermod -L root`.
Yea thats what I was thinking would be the best. Thanks


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
SELinux preventing cvs login bullet45 Linux - Software 1 01-24-2007 05:00 AM
GNOME Session Manager Preventing Login jamberu Linux - Software 1 05-28-2005 08:49 PM
Preventing Login rickseiden Linux - Security 3 12-01-2004 02:45 PM
Preventing root processes... znapper Linux - Security 5 03-18-2004 12:18 PM
preventing root login nuttyvishal4u Linux - Newbie 6 01-07-2003 11:14 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:44 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration