I am working on a Redhat server and one of the users' names appears as "bash-3.0" on the "SSH Secure Shell Client."
His name is appearing correct under
/etc/passwd. How could this happen?
How can I fix this?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
Is the user's default shell different than the others? (also in
/etc/passwd) This could be the potential cause.
You get a "bash" prompt when launching bash in your terminal without configuring a custom prompt. Since it's just happening to one user, they might have a different login shell than the others or they may be launching bash in a login script or at the terminal.
If the default shell is fine (matching other users) then try determining if the
.bash_profile is different than what's in the home folder of other users? ( Could also be
~/.login depending on what you use ... )
The reason why you saw bash version instead of the username after the profile files were deleted was that the command prompt (often containing the username) is set in these files. You would see exactly the same after calling
Interestingly, no command prompt is set in your /etc/profile, which is often the case on modern systems; usually, you have something like
if [ "$PS1" ]; then if [ "$BASH" ]; then PS1='\u@\h:\w\$ ' if [ -f /etc/bash.bashrc ]; then . /etc/bash.bashrc fi else if [ "`id -u`" -eq 0 ]; then PS1='# ' else PS1='$ ' fi fi fi