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.
adduser kitty
rather thanuseradd kitty
.adduser
will create the homedir with proper ownership and permissions and all that; based on the config in/etc/adduser.conf
.sudo login
and log in askitty
. You then get a shell with a colored prompt, which is surprising since nothing in kitty's profile says that the prompt should be colored. Is this correct?/etc/bash.bashrc
? Post the output of the following commands aftersudo login
as kitty:whoami; echo ~; echo "$PS1"; echo "$PROMPT_COMMAND"; cat ~/.bashrc
whoami
returnskitty
,echo ~
/home/kitty
,$PROMPT_COMMAND
comes back empty,cat ~/.bashrc
returnsexport PS1='[\u@\h \w] '
. The only difference is when I log in with kitty's account:[kitty@denuviel-Satellite-L650 ~] echo "$PS1"
[\u@\h \w]
and when I log in with denuviel's accountkitty@denuviel-Satellite-L650 ~ $ echo "$PS1"
${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[01;34m\] \w \$\[\033[00m\]
So why does it assume different values of$PS1
?adduser
or the "Users and Groups" GUI). kitty was created withuseradd
in which case you get a plain user without the default setup; you have to do all that tedious work manually.