|Say you're creating a script where you're need to run something as the User, or you're trying to debug a User cron, but the User doesn't have ssh access. You can use "su" to execute commands as that User.|
Lets say we have User
and we want to run the command
You'd run the following as root:
/bin/su -l -s /bin/sh -c "/usr/bin/id" fredNote that on FreeBSD, it would be:
/usr/bin/su -l -m fred -c "/usr/bin/id"
NOTE if you use any special characters like "quotes" in the command, they must be escaped with the \ character.
© 2018 JBMC Software, Suite 173 3-11 Bellerose Drive, St Albert, AB T8N 1P7 Canada. Mon-Fri 9AM-5PM MST