Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

Same way you get out of every other shell.

exit
share|improve this answer
    
OR pressing CTRL-d at the prompt –  mdpc Dec 24 '12 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 '12 at 3:57
2  
That doesn't sound right; su shouldn't have caused that. Did you perhaps do something else? –  Ignacio Vazquez-Abrams Dec 24 '12 at 3:58
    
It was just su and maybe a - at the end if I can try to remember my hardest. –  ncms1 Dec 24 '12 at 3:59
1  
It is not "stuck in su". Your shell configuration files are missing. Copy them back from /etc/skel. –  Ignacio Vazquez-Abrams Dec 24 '12 at 4:21
show 6 more comments

su and root are the same thing.

To login as another user, do

su username
share|improve this answer
    
But how do I return to the normal [root@hostname]# –  ncms1 Dec 24 '12 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 '12 at 4:02
    
That returns No such file or directory on CentOS 6 –  ncms1 Dec 24 '12 at 4:04
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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