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


Click here to return to the 'Faster User Switching of a different kind' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Faster User Switching of a different kind
Authored by: datajedi on Mar 17, '04 07:47:59PM

If anbody knows how to use su and then run a .app, say TextEdit, as another user, please let me know. Before Panther I would get errors for everybody except root, now it launches it under my original UID.

Best I can do is use X11, or fast user switching, but fast user switching changes the whole desktop.



[ Reply to This | # ]
Faster User Switching of a different kind
Authored by: SOX on Mar 18, '04 12:32:24AM

For some applications the follwoing will work:
open the package contents, find the actual executable, and run this with su.
It wont work for all apps.



[ Reply to This | # ]
Faster User Switching of a different kind
Authored by: jms1 on Mar 18, '04 01:03:57AM
it would look somthing like this:
su userid -c "/Applications/TextEdit.app/Contents/MacOS/TextEdit &"
you will be prompted for the other user's password, and then the program will start running as the other user.

also, something i noticed while trying this... i come from a unix background and am used to typing "su -c 'command' userid"... for some reason, the "su" command in OSX requires the "-c" option to come AFTER the userid. unix hackers beware...

[ Reply to This | # ]

Faster User Switching of a different kind
Authored by: elmimmo on Mar 19, '04 03:49:28AM

Look it up in this hinton why it does not work in all apps and how to do it with the ones that does not work. I wrote this hint before 10.3, and at the time you could only launch applications as a different user if that user was root, because the new user would not have permissions to use the original user's window manager (so no gui allowed, only cli). So, in other words, you could only do sudo the_command_line_of_said_hint_without_ending_'&' and not sudo -user username the_command_line_of_said_hint_without_ending_'&'. I do not know if this has changed in 10.3, since my computer is set with only one account.



[ Reply to This | # ]