• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Using File Permissions and A... > Being Someone Else for a While: su, ...

Being Someone Else for a While: su, sudo

Because Unix is a multiple user operating system, it's sometimes convenient to be able to momentarily switch user IDs so that you can do something as a different user than the one you're currently logged in as. To eliminate the need to log out and log back in under an alternative ID, Unix provides the su command (meaning switch user), which allows you to briefly act as another user for whom you know the login password. The su command is often used to switch to the root user ID for the purpose of performing system maintenance, but it can also be used to switch to any other user ID on the system.

The su command can be dangerous. When you are running as another user, you have all the permissions that the other user has and all of that user's capabilities. If this is another normal user on the system, you can just as easily damage his files as you can your own. If you've su'ed to the root user, you can, with a single typo of an rm command, delete every file on your drive. Table 11.6 shows the command syntax and options for the su command.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint