|
|
|
![]() |
![]() |
||
|
| |||||
![]() | How do I become root? There are actually a couple of ways to accomplish this task. The easiest is to log in as root from the login prompt. If you are already logged in as a non-root user (e.g. your personal system account), it can be a hassle to have to log out and log back in every time you want to become root. To avoid this there is the "su" command - this allows you to "switch users." Simply enter: # su to become root, or: # su USERNAME to become any other valid user on the system. If you need to be operating with the other user's environment settings you will need to include a dash on the command line: # su - jdoe Executing this command will change your user id to jdoe, read his initialization files, and set up your environment just as if you had actually logged in as jdoe. |
|
A user's environment is set when they log into the system. The login process reads the user's environment settings from the shell initialization files (the specific files are dependent on which shell the user is running). The initialization files contain commands that the user wants executed automatically each time they log in, as well as environment variable definitions - like the PATH variable which tells the system where to look for commands entered by the user. |
| * You are viewing a page from LiveFire Labs' sample online UNIX training course. Click here if you do not see a blue and green frame around this page, or view the detailed description for this course. LiveFire Labs - Online UNIX Training |