Limit User To Run Specific Commands
-1
votes
2
answers
509
views
I have a user
test1
that i want to limit it to only run specific commands. I found [this](https://access.redhat.com/solutions/65822) solution and I tested it (logged in with test1 and ran some random commands. none of them worked but date
) and it worked. here is what i did:
cp /bin/bash /bin/rbash
useradd -s /bin/rbash test1
mkdir /home/test1/bin
chmod 755 /home/test1/bin
echo "PATH=$HOME/bin" >> /home/test1/.bashrc
echo "export PATH" >> /home/test1/.bashrc
chattr +i /home/test1/.bash_profile
ln -s /usr/bin/date /home/test1/bin
since I'm more of a DBA than a linux pro like you guys I don't know if this is enough and if there is any other thing i need to do to prevent this test1
from doing anything on system.any suggestion for increasing security?
as you can see, if i create link for a command like ifconfig
:
ln -s /sbin/ifconfig /home/test1/bin
this user test1
can also run add | del | up | down
with ifconfig
. how i can limit this command with for example this option -a
or it can be executed with no options at all?
Asked by BlackCrystal
(786 rep)
Aug 25, 2019, 10:29 AM
Last activity: Aug 25, 2019, 05:53 PM
Last activity: Aug 25, 2019, 05:53 PM