LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 07-01-2006, 08:55 AM   #1
kissme1
LQ Newbie
 
Registered: Dec 2005
Posts: 29

Rep: Reputation: 15
Terminal Prompt Problem


hello everyone,
i am a newbie to red hat and working my way towards learning...i am having a problem that when i open the terminal in red hat linux 9 it shows me bash-2.05b instead of my login prompt i read a post in here about this issue in which the mod told the person to use

P1="[\u@\H \W]" and to include it in the end of bashrc to make it permanent...i added this line to the root's .bashrc file's end and also to the /etc/skel/.bashrc but whenever i restart i get the same prompt back i either have to do su or type the above command to get back to normal
 
Old 07-01-2006, 09:19 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
the two files you've changed will have no effect on a normal user that already exists. that would be /home/username/.bashrc
 
Old 07-01-2006, 11:27 AM   #3
kissme1
LQ Newbie
 
Registered: Dec 2005
Posts: 29

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by acid_kewpie
the two files you've changed will have no effect on a normal user that already exists. that would be /home/username/.bashrc
sir i always login as root and there is no direcotry for root in the home directory so what files should i change???i have changed the .bashrc in the /root folder but still nothing
 
Old 07-01-2006, 11:33 AM   #4
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
It should be PS1, not P1. You also need an "export" in there (i.e. the line should read "export PS1=[\u@\H \W]"). You shouldn't be logging in as root all the time either, make a normal account for everyday use.
 
Old 07-01-2006, 12:34 PM   #5
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
you really shouldn't log in as root all the time, do you not appreciate how dangerous it is??

you also shouldn't call people sir if they have not been knighted, are your boss, or have the ability to put you in prison.
 
Old 07-03-2006, 03:59 AM   #6
kissme1
LQ Newbie
 
Registered: Dec 2005
Posts: 29

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by Nylex
It should be PS1, not P1. You also need an "export" in there (i.e. the line should read "export PS1=[\u@\H \W]"). You shouldn't be logging in as root all the time either, make a normal account for everyday use.
well i usually use the root account cause i am used to logging in to windows using administrator previlages and the system i am using is acting as a network server for squid...is it still dangerous to login as root??? or should i use a normal account and switch to root when i need to change using the su command???and can u tell me what can be the drawbacks of logging in as a root user?

i will try using the export string with the command today

thanks
 
Old 07-03-2006, 04:02 AM   #7
kissme1
LQ Newbie
 
Registered: Dec 2005
Posts: 29

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by acid_kewpie
you really shouldn't log in as root all the time, do you not appreciate how dangerous it is??
i really have no idea and knowledge on this would great
Quote:
Originally Posted by acid_kewpie
you also shouldn't call people sir if they have not been knighted, are your boss, or have the ability to put you in prison.
ok i understand mate i say sir cause most ppl dont like to be addressed straight like bro, man, mate etc
 
Old 07-03-2006, 07:08 AM   #8
kissme1
LQ Newbie
 
Registered: Dec 2005
Posts: 29

Original Poster
Rep: Reputation: 15
ok i was able to remove that bash prompt but i have another problem what i try i connect through vnc to the system i get that .bash prompt again so i have to su to root or any other user but when i do that i i start getting Xlib: Invalid MIT-MAGIC-COOKIE-1 key messages and i cant run gui based programsany suggestions??
 
Old 07-03-2006, 07:21 AM   #9
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
The MIT-MAGIC-COOKIE issue is related to your xhost setup.
See
http://www.cygwin.com/ml/cygwin-xfre.../msg00220.html

Quote:
well i usually use the root account cause i am used to logging in to windows using administrator previlages
That's a very bad habit. Blame Microsoft for it.

If you're constantly logged in as root, you'll do plenty of stuff and may corrupt your system in doing so.
However, if you only temporarily use let's say su to switch to root for a particular job, you're likely to go back to your normal user after the job, thus limiting the risks of system corruption.
Also, keeping root logged in may leave your system vulnerable to additional remote attacks.
Thirdly, what happens if you temporarily go out of your office (assuming your computer is at your office), for instance to grab a cup of coffee? If you didn't remember to activate your screensaver (with password lock), then anyone who enters the room can completely erase your system in mere seconds.
Maybe you can trust your colleagues, and that is very good, but it's a proven fact that many outside "attacks" on networks actually have help from the inside.

To clarify the bashrc issue:
/etc/skel/.bashrc : is used as "default" bashrc settings whenever a new user is created.
root's .bashrc : may not be in /home/root, but for instance in /root instead. Check root's home directory by typing "echo $HOME" , "cd; pwd" or "grep root /etc/passwd" (to be called as root, except for the last one).
Putting the export PS1=... command in root's .bashrc or any user's .bashrc will make it apply only to root or to that user, and only if he's using the Bash shell.
If you want to use the new prompt settings for all users as default, try modifying /etc/bashrc instead.

Check out "man bash" for info on $PS1, $PS2, etc. to customize your prompts.
http://www.linuxjournal.com/article/3215 might help you too.

Last edited by timmeke; 07-03-2006 at 07:28 AM.
 
Old 07-03-2006, 10:27 AM   #10
kissme1
LQ Newbie
 
Registered: Dec 2005
Posts: 29

Original Poster
Rep: Reputation: 15
thank you timmeke for a discrptive answer i would now login as a user and use su more

Quote:
Originally Posted by timmeke
The MIT-MAGIC-COOKIE issue is related to your xhost setup.
See
http://www.cygwin.com/ml/cygwin-xfre.../msg00220.html
i tried that and made a /etc/X0.hosts file and added the following lines to it
#/etc/X0.hosts
127.0.0.1
192.168.0.55(the ip i login via vnc to the system on which redhat is installed)

but still nothing
Quote:
Originally Posted by timmeke
try modifying /etc/bashrc instead.

Check out "man bash" for info on $PS1, $PS2, etc. to customize your prompts.
http://www.linuxjournal.com/article/3215 might help you too.
modified that file and added
export PS1="[\u@\H \W]"
to the end of it but i still get a bash prompt when i login via vnc to the system, when i access the system personally everything is good but via vnc(remotely) it still has a bash prompt

sorry for being so lame but everyone has to be dumb in something
 
Old 07-03-2006, 11:32 AM   #11
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
No need for the apologies, kissme1. You're here to get help with your Linux problems, and we're here to help you with them. No matter what the issue is, no matter how silly you think the problem is.
The fact that you are willing to work on your problem by listening to others is the first step towards the solution.
We all had to learn Linux by reading, practice and getting help at some point (or at least, I have).

Now, as for your problem:
did you also read the follow-ups on the link I provided you. Maybe they contain more clues.
Also, you may want to check your xhost settings.

Hmmm. VNC, as far as I know, only shows you what you would get to see if you were actually sitting at the computer itself. Yes, it requires a login to gain access, but it doesn't really log you on to the system itself. Are you sure it's VNC you're using? Not some other form of remote access like ssh, or ICA?

Anyway, my guess is that the bashrc and/or profile settings are simply not loaded when you connect remotely.
You can always load them by issuing a command like:
Code:
source /home/you/.bashrc
Can you find any related messages in /var/log?
 
Old 07-03-2006, 11:44 AM   #12
kissme1
LQ Newbie
 
Registered: Dec 2005
Posts: 29

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by timmeke
Now, as for your problem:
did you also read the follow-ups on the link I provided you. Maybe they contain more clues.
Also, you may want to check your xhost settings.
any hints on how to do that

Quote:
Originally Posted by timmeke
Hmmm. VNC, as far as I know, only shows you what you would get to see if you were actually sitting at the computer itself. Yes, it requires a login to gain access, but it doesn't really log you on to the system itself. Are you sure it's VNC you're using? Not some other form of remote access like ssh, or ICA?
i am sure its vnc as i use the vncserver command to open it and i have added the whole command to /etc/rc.d/rc.local so it starts automatically and i dont have to go to the system to start it i use vnc client to connect to it and yes it doesnt log me in but whenever i open the system with vnc client the desktop is there even if i dont login the system itself(i.e.the ssytem is still at the startup screen but i am using it normally via vnc)

Quote:
Originally Posted by timmeke
Anyway, my guess is that the bashrc and/or profile settings are simply not loaded when you connect remotely.
You can always load them by issuing a command like:
Code:
source /home/you/.bashrc
did that too still no luck in vnc mode

Can you find any related messages in /var/log?
 
Old 07-07-2006, 05:45 AM   #13
kissme1
LQ Newbie
 
Registered: Dec 2005
Posts: 29

Original Poster
Rep: Reputation: 15
ok i did some reading and found out that $root/.vnc/xstartup is the file that specifies X applications to be run when a VNC desktop is started. If it doesn't exist, vncserver will create a new one which runs a couple of basic applications.

i think that might be the problem cause i am not able to run the application that start with redhat-config extension

here is the xstartup file that i have so that u ppl can analyze and gimme some advice

#!/bin/sh

unset SESSION_MANAGER
exec /etc/X11/xinit/xinitrc


any suggestions now??
 
  


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
desktop shortcut for a terminal prompt mannoulla Linux - Software 9 06-07-2004 02:05 PM
desktop shortcut for a terminal prompt mannoulla Fedora 1 06-04-2004 10:21 AM
How can I change the terminal prompt? ICO Slackware 4 02-15-2004 09:09 AM
no prompt in terminal xyfan Linux - Newbie 1 12-06-2003 12:25 AM
terminal with no prompt fletch88 Red Hat 0 11-17-2003 01:45 AM


All times are GMT -5. The time now is 04:07 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration