Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 03-19-2002, 10:35 AM   #1
Registered: Oct 2001
Posts: 36

Rep: Reputation: 15
Arrow Why Does Prompt Look Like ...

Last night I was practicing adding users using the passwd and shadow file. Used the passwd command to create a password for the new user. Made a home directory for the new user. Copied the default login initialization files to the users home directory.Assigned the appropriate permissions for the home directory and contents.Set the owner and group for these directories. However, when I attempted to login as that user I got the following strange looking prompt.
bash-2.05$. Can anyone tell me why that is and how it can be changed?
Old 03-19-2002, 11:01 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977Reputation: 1977
i'd guess that, assuming you DID copy .bashc and .bash_profile from /etc/skel or another user, that they do not have the correct access rights, and consequenetly the global /etc/bashrc file which would normally set the prompt, path etc could not be accessed. try chmod-ing them to the right name, assuming they exist in the first place. same might be required for the directory you created.

the "useradd" command is there for a reason...
Old 03-19-2002, 11:15 AM   #3
Registered: Oct 2001
Posts: 36

Original Poster
Rep: Reputation: 15
The commands I used included:
#cp /etc/probile /home/user/.profile
#cp /etc/bashrc /home/user/.bashrc

I replaced the user option (or should I write variable) with the username of the actual login name of the user I created. Is there anything wrong in either one of the 2 above commands?
Old 03-19-2002, 11:27 AM   #4
Senior Member
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
Yes both of those commands won't work.

Both /etc/profile and /etc/bashrc are global files. They are used to set things for each user on the system. The .profile and .bashrc in the users home directory are intended for any extra changes the user wants to make which are specific to his/her needs.
So by doing what you did everything in profile and bashrc will be run twice for each user.
Also if you where root when copying the files then the owner will still be root. Those files should be owned by the user itself. So you'll have to run another command like: chown user.user /home/user/.profile

The prompt you got is the default bash prompt usually you would add a line in .bashrc something like the following:
export PS1='\u:\w\$ '
Old 03-19-2002, 11:31 AM   #5
Registered: Mar 2002
Distribution: Mandrake 8.1
Posts: 386

Rep: Reputation: 30
Both /etc/profile and /etc/bashrc are global files.
You definitely don't want to copy these files from /etc. As Acid suggested, just copy the files out of /etc/skel, change permissions and you should be set.
Old 03-19-2002, 11:56 AM   #6
Registered: Oct 2001
Posts: 36

Original Poster
Rep: Reputation: 15
When I did this yesterday I noticed that I could not access a number of commands including shutdown. Did I inadvertently change root's own profile? If so, how do I correct such an error?


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
can not see the prompt ustek Slackware 5 02-13-2004 03:56 PM
Adduser Prompt tapanga Linux - Newbie 1 10-09-2003 06:09 PM
default prompt nero64 Linux - Newbie 6 12-10-2002 07:16 PM
Prompt Atroxic Linux - Newbie 5 01-09-2002 05:43 AM
Prompt name toxic53 Linux - General 1 09-26-2001 12:49 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:43 PM.

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