Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


sudo -u | 12 comments | Create New Account
Click here to return to the 'sudo -u' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
sudo -u
Authored by: makaio on Mar 16, '04 07:47:37PM
On a similar note, you can also use:


sudo -u username command

Assuming you're an administrator, this will let you run a single command as another user. And if you always need to run a command as another user, you can add something like:


alias "command"="sudo -u username command"

to your .bashrc file and it will automatically run this command as the other user.

And finally, for more sudo fun than anyone could possibly handle, check out the sudo and sudoers man pages.

[ Reply to This | # ]

sudo -u
Authored by: jms1 on Mar 18, '04 12:50:57AM

actually it would be the ".tcshrc" file... OSX uses tcsh as the default login shell, not bash.

the line in .tcshrc would look something like this:

alias blah "su -c 'command goes here' userid"



[ Reply to This | # ]