1

I made a new user on my server. The user is not logged into the bash shell on startup. To do this I can run /bin/bash --login and it works.

Where do I place this command so that it runs automatically? I tried ~/.bashlogin', ~/.profile and ~/.bashrc. When I go back to login I see the user logging in, but the shell does looks like a shell without login. E.g.,

user@computer:~/path$
$
$
$

instead of

user@computer:~/path
user@computer:~/path
user@computer:~/path

How to run the command /bin/bash --login without doing it yourself?

user2609980
  • 129
  • 1
  • 1
  • 10
  • Bonus question: how do I add colors to this `user@computer:~/path` thing? – user2609980 Sep 07 '14 at 21:09
  • what is the output of `echo $0` when you login – g4ur4v Sep 07 '14 at 21:13
  • I see `-sh` after running `echo $0` for the new user. After `/bin/bash --login` the result is `/bin/bash`. For root it is `-bash` – user2609980 Sep 07 '14 at 21:18
  • "a shell without login" That's just the prompt, not "the shell", and you can make it look any way you want. You are logged into the shell, but that shell is sh not bash. You want to [change the user 's shell](http://unix.stackexchange.com/questions/22729/where-do-i-change-my-shell). – Leiaz Sep 07 '14 at 21:38
  • 1
    @user2609980 http://unix.stackexchange.com/q/12335/33055 for coloring – Anthon Sep 08 '14 at 05:02

2 Answers2

1

If I understand your problem correctly, you created a new user, but when logging in with that user, you get some other shell, but not bash. If this is your problem, then the solution is to change the shell of that new user to /bin/bash. This can be achieved with

usermod -s /bin/bash user

Laszlo Valko
  • 1,232
  • 8
  • 15
0

I can run the /bin/bash --login command when I place it as the first line of the ~/.profile file. I had another line that set the path variable (i.e., PATH = "blablablabla"; export PATH) and somehow that conflicted.

Now I am logged into the shell with the new user. Thanks for the help.

Only question that remains is how to give it pretty colours.

user2609980
  • 129
  • 1
  • 1
  • 10