Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Run as different user under FreeBSD [closed]

Tags:

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.

like image 920
Slava V Avatar asked Nov 12 '08 22:11

Slava V


1 Answers

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.

like image 167
Brad Ackerman Avatar answered Sep 19 '22 18:09

Brad Ackerman