Linux - NewbieThis 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!
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.
Macs and Ubuntu (I think) do not allow you to su -, you have to use sudo. Apparently this is a good thing.
You can use sudo passwd root to set a root pw and that allows you to do su -
My questions are:
How do you remove the ability to su - so you go back to having to do sudo all the time?
Why is it viewed as a "bad thing" to have su - enabled?
su is a binary (e.g. a file in /bin/su on some systems). You could move this binary to something like /bin/secret_su or a cryptic name then create a wrapper script named su in its place. In the wrapper script you check to see see if the su command was called by sudo and if so you have it execute secret_su - if not you issue a message and exit something like:
Error: You must use 'sudo su' rather than just 'su'.
The reason why use of sudo is considered (by some) to be better is that sudo logs everything it does so theoretically you can see who did what on a system. If this is important to you then you should insure you're sending logging to another server to prevent someone who became root from simply deleting the logs to hide their tracks. In many distros "sudo su" is NOT required.
Last edited by MensaWater; 01-26-2012 at 12:42 PM.
Hey thanks. BTW It wasn't a sleight against ubuntu, it is just because the default setting on an ubuntu server I used was like a mac in having the su - disabled.
Thanks for the help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.