Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Whenever I run a terminal in Linux (Centos), my console line starts with:

bash-4.1$

During the Centos installation, I created a user 'mark'. Later on that day, I needed to change the name to 'john' for some reason.

So I went into these files and changed 'mark' to 'john'

/etc/passwd 
/etc/group
/etc/shadow
mv mark john

After a restart, I'm now getting the bash-4.1$ prompt on the terminal.

share|improve this question
    
Read the usermod and groupmod manpages, man bash will be useful too. Check the startup scripts section. –  dawud May 8 '13 at 6:17
3  
My guess is that you didn't rename your home directory from /home/mark to /home/john. And so you have no profile configuration. –  Zoredache May 8 '13 at 6:34
1  
@Zoredache exactly what I thought. Might need to ensure his permissions will allow him to read the folder if he chooses to rename it. –  Tim May 8 '13 at 17:32
add comment

migrated from serverfault.com May 8 '13 at 6:34

This question came from our site for professional system and network administrators.

1 Answer

Depends on what things you edited in the mentioned files. Probably, as Zoredache mentioned, you forgot to change the /home/mark to /home/john either in the passwd or on the filesystem. Also there is an entry in passwd which tells the default shell for the user.

You can also set default shell of existing user by usermod -s <path to shell> <username> command.

share|improve this answer
1  
CentOS recommends chsh for shell change. –  Tim May 8 '13 at 17:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.