0

I accidentally did

su

with no arguments while logged into the root account.

It then put me into su and at the beginning of the command line, it now shows

-bash-4.1#

How do I "get out of" su and return back to just root?

2 Answers 2

4

Same way you get out of every other shell.

exit
11
  • OR pressing CTRL-d at the prompt
    – mdpc
    Dec 24, 2012 at 3:56
  • But when I do exit, it just completely quits out of PuTTY and when I log back in, its still showing the same.
    – ncms1
    Dec 24, 2012 at 3:57
  • 2
    That doesn't sound right; su shouldn't have caused that. Did you perhaps do something else? Dec 24, 2012 at 3:58
  • It was just su and maybe a - at the end if I can try to remember my hardest.
    – ncms1
    Dec 24, 2012 at 3:59
  • 1
    It is not "stuck in su". Your shell configuration files are missing. Copy them back from /etc/skel. Dec 24, 2012 at 4:21
0

su and root are the same thing.

To login as another user, do

su username
3
  • But how do I return to the normal [root@hostname]#
    – ncms1
    Dec 24, 2012 at 3:58
  • that is just the prompt you are talking about. you can do exit to leave the current prompt or do "source ~/.bashrc" or "source ~/.cshrc" to source default profile of your shell.
    – daya
    Dec 24, 2012 at 4:02
  • That returns No such file or directory on CentOS 6
    – ncms1
    Dec 24, 2012 at 4:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .