Become root, with Its Environment Variables


Become root, with Its Environment Variables

su -

Entering su all by its lonesome is equivalent to typing in su rootyou're root in name and power, but that's all. Behind the scenes, your non-root environment variables are still in place, as shown here:

$ ls /home/scott/libby $ whoami scott $ su Password: $ whoami root $ ls /home/scott/libby 


When you use su -, you not only become root, you also use root's environment variables.

$ ls /home/scott/libby $ whoami scott $ su - Password: $ whoami root $ ls /root 


Now that's better! Appending - after su is the same as su -l root, but requires less typing. You're root in name, power, and environment, which means you're fully root. To the computer, anything that root can do, you can do. Have fun with your superpowers, but remember that with great power comes great aw, you know how it ends.



Linux Phrasebook
Linux Phrasebook
ISBN: 0672328380
EAN: 2147483647
Year: 2007
Pages: 288

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net