Is there a way in FreeBSD to (being root) run a command as unprivileged user, like nobody? Kind of like reverse of sudo. Oh and considering that 'nobody' has /usr/sbin/nologin as shell - so su is not an option.
+12
A:
sudo will allow you to run a command as another user.
sudo -u nobody <command>
will run as nobody, even if their login shell is not available.
DrStalker
2008-11-12 22:52:29
Great! Thanks for help!
Slava N
2008-11-12 22:57:13
tip for bomboze: "man sudo" . do it once.
Kent Fredric
2008-11-12 22:58:32
+1
A:
You can su
to an account with the nologin
shell if you use the -m
option.
Example:
su -m cthulhu -c '/usr/bin/scorpion-stare'
will run the SCORPION STARE command-line utility as the user cthulhu
.
Brad Ackerman
2010-07-13 04:50:35