4.11. Substituting a User: suA lot of people think that su stands for "super-user," but it doesn't. Instead, it stands for "substitute user," and allows you to create a subshell owned by another user (Figure 4-23).
Here's an example of su: $ whoami ...find out my current username. glass $ su ...substitute user. Password: <enter super-user password here> $ whoami ...confirm my current username has changed. root $ ... perform super-user tasks here $ ^D ...terminate the child shell. $ whoami ...confirm current username is restored. glass $ _ The su command is probably most often used to become the super-user. If you will act as the system administrator or have a need to become the super-user on a regular basis, you should also see the description of the sudo command on page 577. |