Slackware This Forum is for the discussion of Slackware Linux.
|
| Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
 |
GNU/Linux Basic Guide
This 255-page guide will provide you with the keys to understand the philosophy of free software, teach you how to use and handle it, and give you the tools required to move easily in the world of GNU/Linux. Many users and administrators will be taking their first steps with this GNU/Linux Basic guide and it will show you how to approach and solve the problems you encounter.
Click Here to receive this Complete Guide absolutely free. |
|
 |
07-15-2006, 07:36 PM
|
#1
|
|
Member
Registered: Aug 2005
Distribution: slackware!
Posts: 43
Rep:
|
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.
|
|
|
|
07-15-2006, 07:41 PM
|
#2
|
|
Member
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511
Rep:
|
I suppose if you really wanted to do that, you could do:
chsh -s /bin/false root
|
|
|
|
07-15-2006, 07:44 PM
|
#3
|
|
Member
Registered: Aug 2005
Distribution: slackware!
Posts: 43
Original Poster
Rep:
|
Thanks for the quick response.
|
|
|
|
07-15-2006, 07:50 PM
|
#4
|
|
Member
Registered: Jan 2006
Location: Bakersfield, California
Distribution: CentOS 5.3, FreeBSD 7.2, Fedora 11
Posts: 83
Rep:
|
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?
|
|
|
|
07-15-2006, 07:54 PM
|
#5
|
|
Member
Registered: Jul 2001
Distribution: Slackware 12
Posts: 511
Rep:
|
It does sound like it could break some stuff now that I think about it. That was just the first way I thought of.
|
|
|
|
07-15-2006, 07:55 PM
|
#6
|
|
Member
Registered: Aug 2005
Distribution: slackware!
Posts: 43
Original Poster
Rep:
|
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.
|
|
|
|
07-15-2006, 09:58 PM
|
#7
|
|
Moderator
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733
|
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.
|
|
|
|
07-17-2006, 03:03 AM
|
#8
|
|
Senior Member
Registered: Mar 2006
Distribution: SLACKWARE 4TW! =D
Posts: 1,515
Rep:
|
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?
|
|
|
|
07-17-2006, 04:42 AM
|
#9
|
|
LQ Newbie
Registered: Jun 2005
Location: Queen City of the South, Cebu City
Distribution: slackware-current
Posts: 12
Rep:
|
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.
|
|
|
|
| Thread Tools |
Search this Thread |
|
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -5. The time now is 11:24 PM.
|
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|