LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 09-08-2006, 03:10 PM   #1
baabakb
LQ Newbie
 
Registered: Aug 2006
Location: DC area
Distribution: Suse 10.2 and loving it
Posts: 20

Rep: Reputation: 0
Root Prompt Changed


Hi All,

I am not sure exactly what happned but the root prompt in terminal session has been changed from

[root@localhost]#

to

bash-3.1#.

I changed the Shell from bash to sh (I read on the forum that it is not recommended to have the root shell set on bash, not quite sure what it means - very new in linux). Now the prompt of course is saying

sh-3.1#

I would need to ask what could have happened and do I need to change it and how can I change it?

Thanks,
 
Old 09-08-2006, 04:21 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Which forum did you read that on?

The only thing you shouldn't be doing is to be logged in and work
as root - which shell you're using won't make much difference in
Linux, since sh is just a symlink to bash on pretty much all distros.


Cheers,
Tink
 
Old 09-08-2006, 05:45 PM   #3
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
The only people that I know who don't recommend bash as roots default shell are the bsd guys. In Linux sh is just a symlink to bash, so explicitly choosing sh does not really achieve much.
 
Old 09-08-2006, 05:48 PM   #4
AwesomeMachine
LQ Guru
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora; Mint
Posts: 5,524

Rep: Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015Reputation: 1015
I just wanted to repeat what the TWO moderators said: "sh is a symlink to bash". I think you can get your original prompt back by typing:

bash
 
Old 09-08-2006, 09:03 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by reddazz
The only people that I know who don't recommend bash as roots default shell are the bsd guys. In Linux sh is just a symlink to bash, so explicitly choosing sh does not really achieve much.
It does make a difference in Solaris, the sh root uses there
is a statically linked executable, and not just a symlink to a
different shell. The advantage is that even if /lib or /usr/lib
were on separate file-systems and their mounting failed for
some reason you'd still have a shell :} (or something like that -
it's been a while that I was on my course, and never had any
issues that would warrant a closer examination since).


Cheers,
Tink
 
Old 09-08-2006, 09:31 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
It makes a difference in Linux as well. From O'Reilly's Learning the bash shell:
Quote:
If bash is started as sh its startup behaviour will change slightly to mimic the Bourne shell as closely as possible. For login shells it only attempts to read /etc/profile and ~/.profile, ignoring any other startup files like ~/.bash_profile. For interactive shells it won't read the initialisation file ~/.bashrc. bash also enters POSIX mode when started as sh. Versions of bash prior to 2.0 don't...
I'm only nit-picking because I don't have anything to add...
 
Old 09-09-2006, 03:55 AM   #7
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
Quote:
It makes a difference in Linux as well. From O'Reilly's Learning the bash shell:
Quote:
Quote:
If bash is started as sh its startup behaviour will change slightly to mimic the Bourne shell as closely as possible. For login shells it only attempts to read /etc/profile and ~/.profile, ignoring any other startup files like ~/.bash_profile. For interactive shells it won't read the initialisation file ~/.bashrc. bash also enters POSIX mode when started as sh. Versions of bash prior to 2.0 don't...
I'm only nit-picking because I don't have anything to add...
Yeah, but you will still be using bash even though its mimicking sh behaviour. On FreeBSD and Solaris, sh is a totally different shell to bash.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Hostname was changed on the command prompt pretty.tulip Linux - Newbie 1 04-02-2006 11:21 PM
Root passwd changed Tinku Linux - Security 9 10-22-2004 12:52 AM
someone changed my root password. what do i do? budds Linux - Security 4 09-12-2004 12:09 AM
changed language in the root flsherri Mandriva 0 03-21-2004 03:36 PM
user comand prompt changed - don't know why sadmac Linux - Newbie 2 04-24-2003 12:40 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 09:08 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration