Contact us |
Set user
It changes the current user to have the access rights of the temporary user. The HOME, LOGNAME, and USER environment variables will be set to those of the temporary user by default. To temporarily become another the user “me” 1. While logged in as the root user, switch to the user “me”. Type root@localhost root# su me me@localhost root$ The su command did not prompt you for the user me’s password because you are root 2. Change to me’s home directory. me@localhost root$ cd me@localhost me$ cd 3. While temporarily logged in as me, use su to login as the user ying. Type: me@localhost me$ su ying password: ying@localhost me$ 4. To logout of ying’s account type: ying@localhost me$ exit This will throw you back into me’s account. 5. Logout of me’s account to get back to the root account. What is the command? To make su inherit all environmental variables of the new user 1. To force “su” to use all the environmental variables of the temporary user. Type: root@system1 root# su – me me@system1 me$ The difference is immediately obvious. Notice the current working directory. 2. Logout of the system completely and reboot the machine.
|
Login... |
||||