Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

Note: "I have the script's owner set as root" doesn't do anything; even if you have the setuid bit set it still doesn't workstill doesn't work


Assuming you're actually running the script as root, however, you can use sudo. su is primarily for switching users, while sudo is for executing commands as other users. The -u flag lets you specify which user to execute the command as:

sudo -u hudson command

Note: "I have the script's owner set as root" doesn't do anything; even if you have the setuid bit set it still doesn't work


Assuming you're actually running the script as root, however, you can use sudo. su is primarily for switching users, while sudo is for executing commands as other users. The -u flag lets you specify which user to execute the command as:

sudo -u hudson command

Note: "I have the script's owner set as root" doesn't do anything; even if you have the setuid bit set it still doesn't work


Assuming you're actually running the script as root, however, you can use sudo. su is primarily for switching users, while sudo is for executing commands as other users. The -u flag lets you specify which user to execute the command as:

sudo -u hudson command
Source Link
Michael Mrozek
  • 95.7k
  • 40
  • 245
  • 236

Note: "I have the script's owner set as root" doesn't do anything; even if you have the setuid bit set it still doesn't work


Assuming you're actually running the script as root, however, you can use sudo. su is primarily for switching users, while sudo is for executing commands as other users. The -u flag lets you specify which user to execute the command as:

sudo -u hudson command