Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Is using the su command in a console the exact same as if I had logged in as root to begin with? I.e., for applications that need to be installed by root, can I log is as my usual user and use the su command rather than continually logging out and back in?
you don't ever have to continually log in and logout of root (in fact, i highly discourage your ever using root's graphical interface, DoN't Do It!)
just go into konsole or terminal, and when root is ever needed, type su and then enter your password when it asks, when u need to get out of su, i'm not sure if there is a command, but just exit the terminal window and start a new one
when you use the "-" it tells you to use the path for the user that you are switching too...
so for instance if you have /sbin in your roots path and you are logged in as a normal user and just type su and then type your root password and then following by typing lets say "hdparm" it will say command not found...
but if you switch user to root using "su -" and type the password and then issue the command "hdparm" you will be able to use this command without having to specify the path, as you would have to type /sbin/hdparm if you only typed "su" to change users..
Originally posted by Steve Cronje To "go back" i.e. leave being root in a term, just type su <username>
eg: su barry
to get you back to where you came from
Are you sure that won't just launch an additional login for barry?
I tried that. I ran 'su -', logged in as root, and then simply ran 'su bsl1' to go back as you said, but that did create an additional login for bsl1. I was still in the root directory. I had to type exit twice to get back to my original login.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.