View Full Version : About su -

18th July 2006, 06:11 PM
I found out how to become root easily. How do I then get back to being an ordinary user in the same terminal? I didn't see it in the faqs, prolly there though.


18th July 2006, 06:12 PM
Type "exit".

18th July 2006, 06:13 PM
You can also use the keyboard shortcut: Ctrl+D

18th July 2006, 06:38 PM
Nice short-cut ;) But I have one related question: what is the difference between su - and su (with and without dash)?

18th July 2006, 06:44 PM
su - also sets paths etc for root so most of the time you want su -

18th July 2006, 06:45 PM
su - (with the dash) makes it as though you'd actually logged in as the user (in this case, root); it processes login scripts, etc. This is almost always what you want to do, because of the paths and all that, and some things won't run properly if you just do 'su' (without the dash).

If you do 'su' (no dash), it leaves you in your current directory, though, and if you fully understand the different between su and su -, it can be handy sometimes.

Someone else, I'm sure, can explain it better than that. :) A Google search would, I'm sure, turn up plenty of explanations, too.

18th July 2006, 06:54 PM
Thanx. Much more understand it now. ;)

18th July 2006, 08:42 PM
Thanks everybody, I just knew it had to be simple, but I couldn't see it anywhere!