SlackwareThis 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.
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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.
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?
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.