Ubuntu – Creating new user, inconsistent bash prompt

bashbashrccommand lineprompt

I've created a new user profile with:

    useradd kitty
    passwd kitty
    mkdir kitty
    chmod 0700 kitty
    chown -R kitty:kitty
    adduser kitty sudo

    #when I did it I initially didn't notice I'm using two different commands,
    #hence the inconsequence, but as I've read up there are interchangeable anyway,
    #just listing it in case it actually makes any difference

I've also created a .bashrc file in kitty's home folder, with the contents of:

   export PS1='[\u@\h \w] '

Initially tab completion didn't work, and the prompt for kitty was a standard $ sign, and altough I've tampered with /etc/profile /etc/bash.bashrc /etc/bash_completion and created .bashrc in the home directory for both my main user and kitty, I've ended up reversing all the changes, and only leaving the .bashrc file in the kitty's home directory. So I guess it was the restart that resolved these isssues (sic.).

The problem now is: when I log in as kitty in the terminal window on my main profile, the prompt appears such as my main profile's, with all the formatting (color/boldness), but when I log in as kitty her native bash prompts have standard formatting. Why?

EDIT: as I've noticed there is also a slight difference in the content of prompt, the one on my main profile being followed by a $ sign and kitty's lacking the $ sign and being enclosed in square brackets.

I switch between profiles using sudo login and exit in the terminal window. When I log in as kitty at the start of the system, in the terminal it switches between the colored (logged as my main user) and standard (kitty's) one. If at the start of the system I log in as my main user it colors both (kitty's and main user's) in the same manner.

Best Answer

It looks like kitty's shell is /bin/sh. This is a shell that's intended for scripting, it doesn't support fancy prompts, completion, command line edition and other interactive features. Change kitty's shell to /bin/bash:

chsh -s /bin/bash kitty