Basically what I want to be able to do is to switch to having used "su -" instead of the traditional hyphenless "su" after already using "su" to switch to another account.

My initial thought was to do another "su -" but that sounded a bit silly, is there a better way to do this?

  • 1
    Couldn't you un-su and then su -? – Wutaz Jun 18 '13 at 14:54

You could run the user's shell profile like this:

. ~/.profile

That's a dot, space, tilde, slash, dot, then the word profile

You can read about profile here.


You can start a subshell as login shell, e.g. bash -l.


you're right, there's nothing that keeps you from just doing su -User2 and ending up with something like User1->root->User2. You can also just type exit to end the "su" session and drop back down to User1 and then type su -User2

  • FYI, some implementations of su require a space between the - and the username. – depquid Jun 18 '13 at 15:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.