Search code examples
bashtty

Bash doesn't works for new user


I've just created a new user in my machine with adduser --system --group studio for audio purposes, and everything went ok until I've tried to open a terminal, which opened and closed immediately. I've tried using other terminals (xfce4-terminal, Xterm and UXterm) and the problem persisted.

Then I've tried logging in a tty, which showed a strange behavior: it logs in, shows that message Last login: bla bla bla, and quickly comes back to login screen. So I think the problem is with bash and this specific user. Logging on a tty with the older user still works.

I've also tried creating the files .bashrc and .profile (actually copying them from the working user), but it didn't fixed the problem either.

This is a very strange behavior for me, and I've never seen this before. As I can't access any shell from this user, I'm not able to diagnose the problem. I've checked dmesg and all logs possible and nothing shows up when the error happens. I'm using Debian Wheezy and XFCE4. My uname -a is:

Linux t4rkus-nb 3.2.0-4-rt-686-pae #1 SMP PREEMPT RT Debian 3.2.35-2 i686 GNU/Linux

Solution

  • Why are you passing the --system flag? From the manpage:

    The new system user will have the shell /bin/false (unless overridden with the --shell option), and have logins disabled. Skeletal configuration files are not copied.

    Meaning the new user has /bin/false as the shell, which immediately exists when you try to log in with it.