Linux/Bash: Run a command as another user
Other than the sudo is there a way to execute a command as another user ?
Suppose there a cluster manager running as ROOT and It accepts commands from users . All the commands have to be run using the submitted users privilege. So it there a better solution other than using the sudo command ?
Just got the su username -c "command " .
Any other ways ?
Re: Linux/Bash: Run a command as another user
You can use the setuid bit to run a particular command as the owner of the executable:
Quote:
# chown someuser command
# chmod u+s command
$ ./command
"command" will get run with "someuser" priviledges.