Run command as another user

If the user has a shell:

su [user] -c "[command]"

If they don’t have a shell:

su -s /bin/sh [user] -c "[command]"

Last modified: 01/06/2011 Tags:

Related Pages

Other pages possibly of interest:

This website is a personal resource. Nothing here is guaranteed correct or complete, so use at your own risk and try not to delete the Internet. -Stephan

Site Info

Privacy policy

Go to top