2

I've designed my bash prompt like this \u@\h>

When i now create the User example with adduser, my prompt looks like example@host> But when i create a User with useradd, my prompt looks like \u@\h>

PS1: \[\e]0;\u@\h: \w\a\]${debian_chroot:+($debian_chroot)}\[\033[01;31m\]\u\[\033[01;33m\]@\[\033[01;36m\]\h \[\033[01;33m\]\w \[\033[01;35m\]\$ \[\033[00m\]

PS2: >

PS3: empty

PS4: +

Any ideas how to fix this?

2 Answers2

3

useradd creates users with the /bin/sh shell by default. If you want a different shell for the user, you just have to add the -s option like useradd -m -s /bin/bash {username} and you will be fine.

0

First:
The attributes you have customized are inherited by .bash_profile and/or .bashrc in each users home directory so unless you modify the versions in /etc/skel the changes will only be good for the current user.
In response to your question:
My guess is that you simply do not have a home directory as unless you run useradd with the -m option it will not create the home directory (/home/user).

Eddie Dunn
  • 473
  • 2
  • 9