LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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, 04: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, 05:21 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 06:45 PM   #3
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
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, 06:48 PM   #4
AwesomeMachine
Senior Member
 
Registered: Jan 2005
Location: USA and Italy
Distribution: Debian testing/sid; OpenSuSE; Fedora
Posts: 1,829

Rep: Reputation: 257Reputation: 257Reputation: 257
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, 10:03 PM   #5
Tinkster
Moderator
 
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,066
Blog Entries: 11

Rep: Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910Reputation: 910
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, 10:31 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,125

Rep: Reputation: 164Reputation: 164
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, 04:55 AM   #7
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 74
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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-03-2006 12:21 AM
Root passwd changed Tinku Linux - Security 9 10-22-2004 01:52 AM
someone changed my root password. what do i do? budds Linux - Security 4 09-12-2004 01:09 AM
changed language in the root flsherri Mandriva 0 03-21-2004 04:36 PM
user comand prompt changed - don't know why sadmac Linux - Newbie 2 04-24-2003 01:40 AM


All times are GMT -5. The time now is 06:27 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration