Quote:
Originally Posted by
as7951
I tried the below to achieve what i want to some extent.
This is exactly the thing we talked about
: what you did can easiy be undone by the person you tried to block. Here, i am allowed to do "everything but" some commands, so i use another command (here:
visudo) to remove the rule you just edited into
/etc/sudoers to edit it out again. After this your carefully crafted limitation of my possibilities doesn't exist any more.
Or, as Corona688 said, i simply leave the limitation in place and use
vi to edit
/etc/passwd (and probably some shadow files, depending on your system and its setup) directly to do manually what
useradd and
userdel do automatically. I won't even need these commands to create or remove users.
Or i could, using the still allowed command
su, switch to another user and execute
useradd and
userdel from there.
Or i could use
cp to copy a shell executable somewhere, use
chmod to set its sticky bits, then execute it as my user and could still execute the forbidden command because inside the shell i have a different effective user ID and the limitation won't apply to me any more.
Or i could ...
What you did was to carefully lock one door - but leaving open hundreds of others leading to the same room. If you want to prevent me from getting into there it doesn't matter if i have 100 or only 99 options available.
Bottom line: what you have is NOT a solution, not even a partial one and we are trying to tell you exactly that for several posts now. You are of course free to ignore this advice but what is the point of asking in first place if you refuse to hear the answer because you don't like it?
I hope this helps.
bakunin