Faster User Switching of a different kind

Mar 16, '04 10:11:00AM

Contributed by: jasonM

Many people may be familiar with the su UNIX command and its sibling sudo. This allows a user to do stuff as the "root user." However, the su command can also be used to change the identity of a user (and thus have access to a different set of files) when running Terminal, or a *term in X11.

In my particular case, I have the original account I created when I first isntalled OS X, and I recently created an acount for programming and web serving. These accounts belong to different UNIX "groups," so when I think up a solution to a programming problem while surfing the web in my original account, I can't simply open a Terminal and cd to the other account. However, from the same terminal, I can do the following:

 % su other_account_name
I will be prompted for the password to the other account, and thus logged in as the web server/programming user. What's more, since I've stuck with the original prompt that Mac OS X has set up, it lets me know that I'm the web server/programming user. Typing exit at any point brings me back to my original account.

Comments (12)


Mac OS X Hints
http://hints.macworld.com/article.php?story=20040310172349648