user's prompt changed to '$' from user's name

Asked by Glen Devendorf on 2013-05-24

recently one of the user's prompt has changed from username@hostname-$ to only '$' in ubuntu 12.04. this occurred after permissions for same user was somehow changed in ls -al from username to 1001 and was unable to boot using user's name. I subsequently ran these commands: sudo chown -R administrator:administrator /home/administrator
                                                                 sudo chown -R (name):(name) /home/(name)
Afterwards I was able to login with the user's name but the terminal prompt for that user has changed to '$'. There are 2 other users and there is no problem with those. All help appreciated.

Question information

English Edit question
Ubuntu gnome-terminal Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Best Ubfan (ubfan1) said : #1

The $ probably indicates that the sh shell is running instead of bash. Look at the file /etc/passwd, the last entry on the user's line is the program to run, so it should be /bin/bash, not /bin/sh. You can check what is running by logging in as the user and typing ps to see what's running, expect to see sh and not bash. You can just edit the passwd file using sudo and change the entry if necessary.

Glen Devendorf (gdawg65) said : #2

Thank you for your reply Ubfan. I entered 'grep jane /etc/passwd' and I was in ' /bin/bash'. There are 2 standard users and 1 administrator on this distros and jane is one of the standard users. I was able to login with jane using Ctrl-Alt-F2 and 'ls -al' revealed that jane no longer owned /home/jane. I don't know what caused this, possibly some update? The other users could login fine. I ran 'sudo chown -R administrator:administrator /home/administrator'
'sudo chown -R jane:jane /home/jane' and that solved the problem. One time during my attempt to solve the problem I deleted and added jane via the terminal. The terminal command I used was 'userdel' and 'useradd'. I discovered that I should have used 'adduser' in Ubuntu. Thanks again for your help.

Glen Devendorf (gdawg65) said : #3

Thanks Ubfan, that solved my question.