Linux - SecurityThis forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.
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.
I've installed sudo and sudoscripting on my RHEL AS3 implementation. I would now like to prevent everyone from su"ing" to the root user. I'd prefer that all use the "ss -u root" command as it will provide a much better audit trail. Can anyone point me in the direction of how I can prevent su to root. Thanks.
Reddazz, I already read that (that's RHL 9 workstation security). The info is good, but I'm just tring to lock down "su -". Have yet to come across a simple way to do it. thx.
Now the only people who will be allowed to 'su' to root must be part of the wheel group. Just make sure the people you want to be part of the wheel group are part of that group first, otherwise you may not be able yourself to 'su' to root after this to add them to it.
Plus you can add this to the /root/.bashrc file and this will email you if someone manages to 'su' to root or login as root:
But if add the line to /root/.ssh/rc file (might need to create it first)it is apparentely read before they have actually logged in, I haven't had a chance to verify this just yet
Thats exactly what the article I linked to was suggesting but jwholey said it wasn't helpful. This is the way its done in FreeBSD. You cannot use su unless you are part of the wheel group.
Thats exactly what the article I linked to was suggesting but jwholey said it wasn't helpful. This is the way its done in FreeBSD. You cannot use su unless you are part of the wheel group.
I didn't read your link till now, but I have seen that page in the past. The only way then to lock it down quickly and simply would be to change the permissions and groups.
That is why FreeBSD and all the other unix are very secure and stable.
I didn't read your link till now, but I have seen that page in the past. The only way then to lock it down quickly and simply would be to change the permissions and groups.
That is why FreeBSD and all the other unix are very secure and stable.
True. I think the problem with some Linux distros is that a lot of things are being dumbed down by distro maintainers because they want non technical people to be able to use Linux as well. So out of the box the BSDs are usually more secure than Linux, but Linux can be configured to be highly secure by a good sysadmin.
Is there any reason you can't just chmod -x /bin/su? If you want to prevent everyone from using that command, would that work or is there some other problems this would cause that I'm not aware of? I would like to know, just out of curiosity.
Is there any reason you can't just chmod -x /bin/su? If you want to prevent everyone from using that command, would that work or is there some other problems this would cause that I'm not aware of? I would like to know, just out of curiosity.
That will only stop them from executing it, but through the permissions some users will still be able to have access to the file.
Plus it's not a good idea to restrict all users and not allow atleast one user from being able to 'su' to root.
If you have secured the machine properly and disallow root to login from console, remote, SSH and GUI(KDM and GDM) then you will never be able to administer the system or add software to it, basically locked root out for good.
Add yourself to the root/wheel group and go into /etc/pam.d/su and uncomment out:
auth required pam_wheel.so
Before you log out of the root open another terminal and login as a regular user and try to su. If you can it worked. If not since you're still root in another shell go in and fix it. Also I would recommend going into /etc/securetty and deleting all the contents. This will block root from logging in directly on your machine. Then go into /etc/sshd_config and change permitrootlogin to no. This will stop someone from logging in remotely as root. I also recommend changing the protocol to 2 only. Now the only way to be root is by su from an account in the wheel/root group. PAM won't be affected go apps that prompt for a root password like kuser and such will still prompt you for the root password. Get bastille as well to lock down your system.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.