LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 07-15-2006, 07:36 PM   #1
n00bified
Member
 
Registered: Aug 2005
Distribution: slackware!
Posts: 43

Rep: Reputation: 15
Disable root login [solved]


How do you disable root's ability to login to slackware? Like in ubuntu. I find myself forgetting I'm root and doing bad things all the time, and it would be easier just to force myself to use sudo.

Last edited by n00bified; 07-15-2006 at 07:44 PM.
 
Old 07-15-2006, 07:41 PM   #2
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Rep: Reputation: 32
I suppose if you really wanted to do that, you could do:

chsh -s /bin/false root
 
Old 07-15-2006, 07:44 PM   #3
n00bified
Member
 
Registered: Aug 2005
Distribution: slackware!
Posts: 43

Original Poster
Rep: Reputation: 15
Thanks for the quick response.
 
Old 07-15-2006, 07:50 PM   #4
Voltar
Member
 
Registered: Jan 2006
Location: Bakersfield, California
Distribution: CentOS 5.3, FreeBSD 7.2, Fedora 11
Posts: 83

Rep: Reputation: 15
You could always add

PermitRootLogin no

to /etc/ssh/sshd_config and disable root's ability to login via ssh. It's a security plus and it makes you use 'su'. However root can still login on the box itself.

I'd think changing root's shell would break a lot of things though?
 
Old 07-15-2006, 07:54 PM   #5
Wynd
Member
 
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511

Rep: Reputation: 32
It does sound like it could break some stuff now that I think about it. That was just the first way I thought of.
 
Old 07-15-2006, 07:55 PM   #6
n00bified
Member
 
Registered: Aug 2005
Distribution: slackware!
Posts: 43

Original Poster
Rep: Reputation: 15
Yeah.. umm it does break things.. Just after five minutes I've noticed some issues, with package management mostly.

Thanks for your ssh tip, but I don't have SSHd starting automatically, this is a laptop.
 
Old 07-15-2006, 09:58 PM   #7
jschiwal
Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654Reputation: 654
I think that how Ubuntu does it is to disable the root account. You can use the passwd command to do it. "sudo passwd -l root" to lock out root, and "sudo passwd -u root" to unlock it. The effect will be to add a "!" character in front of the /etc/shadow encrypted password field.

You will want to make sure that you can log into single mode, or using a rescue disk, in case this causes problems and you need to be root to change back. I tested this with a dummy user account but not with the root account while composing this post.

Also, edit your /etc/sudoers file using "visudo" to grant yourself permission to run root commands using sudo. Making yourself a member of the "wheel" group and uncommenting the line for %wheel in visudo is the way it usually is done. ( You probably have already done this. )

The sshd_config tip is a good one, and I would do it anyway, in case you decide to use it in the future and enable sshd temporarily. I would also recommend adding your user name to "AllowUsers" and uncommenting that entry. This way, a hacker would only be successful by guessing both your username and password.

Last edited by jschiwal; 07-15-2006 at 10:03 PM.
 
Old 07-17-2006, 03:03 AM   #8
Old_Fogie
Senior Member
 
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515

Rep: Reputation: 62
I could be wrong, but doesnt the 'sudo' in Ubuntu time out after 15 minutes or so.

So in theory if he get's rid of root, the does sudo once, wouldnt every thing he does for now on be as root and effectively get himself into trouble?
 
Old 07-17-2006, 04:42 AM   #9
snewp
LQ Newbie
 
Registered: Jun 2005
Location: Queen City of the South, Cebu City
Distribution: slackware-current
Posts: 12

Rep: Reputation: 0
i have tried like giving a certain user that can do the command su but unfortunately i forgot how i did it. is there someone who can refresh my memories? thanks.
 
  


Reply


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
Disable Root login via ssh UltraSoul Solaris / OpenSolaris 3 02-09-2007 02:18 AM
vsftpd - how do I disable root login? hunterhunter Linux - General 5 03-27-2006 04:55 PM
disable root login with ssh linuxtesting2 Slackware 3 02-16-2005 12:33 PM
how to make root login disable vijaysh Linux - Security 2 02-08-2005 12:48 PM
How can I disable root login with SSH? blk96gt Slackware 9 10-02-2004 07:09 AM


All times are GMT -5. The time now is 11:26 PM.

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