Results 1 to 9 of 9
Thread: Restrict Commands.
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Jun 2005
Unless a normal user knows the root password, they can't use a command like su. At least, it won't do anything. Even if they tried 'sudo', their normal user password wouldn't work unless the user was specifically added to the sudoers group.
Don't mean to sidestep your question, but do you have a better example of what commands you want to restrict?Registered Linux user #270181
you can make the executable for su (/bin/su) only available for people within a group, I think this is done already with the wheel group, if their a part of the wheel group they can access in, if otherwise, not.
I'll base my following example on /sbin/ifconfig. Firstly create a group (do all of the following as root)Code:
chgrp leet /sbin/ifconfigCode:
chmod 554 /sbin/ifconfigCode:
usermod -g leet john
I don't think a wheel group exists in Linux as it does in BSD (at least that I know of). But your steps here are actually a very good idea for hardening Linux a bit, for a multi-user system.
edit: Hmm, I take that back. The wheel group exists in /etc/group under SuSE. However, my account is not a member and can still su.
- Join Date
- Apr 2005
The wheel group also exists on Debian, Slackware, and I suppose on other distro's also, it is mentioned in the sudoers file, amongst others...Debian Jessie x86_64 & armhf :: LibreELEC is the solution for your Linux-based HTPC setups.
There is an option in /etc/login.defs called SU_WHEEL_ONLY which you can change to yes to have wheel access only, after that you need to add users to the root group of /etc/group in order for them to use su, anyone not in the group will be met with this messagebash-2.05b$ su
You are not authorized to su root
07-05-2005 #8There is an option in /etc/login.defs called SU_WHEEL_ONLY which you can change to yes to have wheel access only
Well, these excellent ideas got me exploring in SuSE. I found that adding the entry to /etc/profile.defs does not work correctly (in SuSE 9.2) - that or I implemented it incorrectly. But it seemed pretty straightforward.
One way that does work (in SuSE 9.2) is adding the entryCode:
auth required pam_wheel.so
Then of course any user you want to be able to su to root must be in the wheel group.