LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   A question about different shells (https://www.linuxquestions.org/questions/linux-newbie-8/a-question-about-different-shells-681962/)

djuro-san 11-08-2008 07:27 AM

A question about different shells
 
Hello,

Why is it that when I SSH to one server, I get the shell prompt in the following format:

[root@server1 ~]#

And on another, I get it like this:

bash2.0 $

Both are Bash shells, so what is the difference?

Many thanks!

colucix 11-08-2008 07:32 AM

Basically, different operating systems set different prompts. The first one you posted is a Red Hat/Fedora like prompt. The other one is a generic bash prompt. The environment variable PS1 controls the way a prompt is displayed.

pixellany 11-08-2008 07:36 AM

Short answer: Because they are configured differently....

What you need is to change the PS1 variable. Here's one article on how to do it:
http://www.cyberciti.biz/tips/howto-...up-prompt.html

I thought there was a man page....???

klearview 11-08-2008 07:36 AM

No difference - it's just that bash environment is set up differently on different machines (see ~/.bashrc , /etc/profile) where variables can be set any way you want it, including prompt, colours etc.

('#' normally means you're logged in as root, and '$' - as ordinary user)

mrclisdue 11-08-2008 08:06 AM

Quote:

Originally Posted by djuro-san (Post 3335281)
Why is it that when I SSH to one server, I get the shell prompt in the following format:

[root@server1 ~]#


I'm hoping you're not allowing root login via ssh....

cheers,

pixellany 11-08-2008 08:11 AM

Quote:

Originally Posted by mrclisdue (Post 3335305)
I'm hoping you're not allowing root login via ssh....

cheers,

Off-topic, but......If I were using SSH to get into another computer (server or otherwise) to do system maintenance, how would I do this without logging in as root?

klearview 11-08-2008 08:16 AM

Quote:

Originally Posted by pixellany (Post 3335309)
Off-topic, but......If I were using SSH to get into another computer (server or otherwise) to do system maintenance, how would I do this without logging in as root?

Log in as normal user, then 'su'.

First thing I do on any machine I have to adminster via ssh - disable root login, change port, disable password authentication.

mrclisdue 11-08-2008 08:18 AM

Quote:

Originally Posted by pixellany (Post 3335309)
Off-topic, but......If I were using SSH to get into another computer (server or otherwise) to do system maintenance, how would I do this without logging in as root?

I would login as a user, then either sudo, or su to root. Teeny little security measure (at its simplest level, an adversary would then have to circumvent authentication measures twice...)

I agree, off-topic, tho'.

cheers,


All times are GMT -5. The time now is 01:57 AM.