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


Click here to return to the 'Execute commands as another user' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Execute commands as another user
Authored by: MasterUltan on Feb 20, '03 11:10:41AM

su bob will work just fine if all you want to do is change to another identity; you don't need to su to root first if you know that id's password. At the password prompt, just type "bob's" password.



[ Reply to This | # ]
Execute commands as another user
Authored by: tobyc on Feb 20, '03 11:41:25AM

This of course only works if you an administrator. You can't su to root or any other user if you are not an admin on the box.



[ Reply to This | # ]
Execute commands as another user
Authored by: mervTormel on Feb 20, '03 12:54:38PM

Only users in group "wheel'' (normally gid 0) or group "admin'' (normally gid 20) can su to "root''.



[ Reply to This | # ]
False
Authored by: MasterUltan on Feb 20, '03 09:04:33PM

The su command will work as ANY user, regardless of privilege. If I am logged in as "sam" and wish to execute commands as "joe", I type:

su joe

and then enter the password for the user "joe". No admin privileges necessary, just password knowledge.

I frequently use this command on UNIX-like machines to help friends or perform some tasks when they are logged into the machine. I often su to my account to access a file, for example.



[ Reply to This | # ]