2

I created a new user. Added all the groups that the "pi" user belonged to. When I try to login with that user, it just keeps recycling back to the login.

If I login with the user "pi", I can su to the user with the same password.

What am I missing?

5
  • 1
    What operating system are you using?
    – Jacobm001
    Commented Aug 17, 2017 at 17:48
  • 1
    What was the exact set of commands you've used?
    – Jacobm001
    Commented Aug 17, 2017 at 17:50
  • 1
    It's also worth noting that when you use su with administrator rights (like the default pi user has) you don't need to use their password.
    – Jacobm001
    Commented Aug 17, 2017 at 17:50
  • 1
    What does the user's entry in /etc/passwd look like?
    – stevieb
    Commented Aug 17, 2017 at 19:34
  • Its very confusing, but adduser and useradd are very different. adduser creates the home directory and sets up password and defaults, useradd just adds the entry in /etc/passwd
    – crasic
    Commented Sep 12, 2017 at 22:16

3 Answers 3

2

First, delete the user created.

Next, I type $ groups pi to check the group's user pi belong. Then I create a new user with the command

$ useradd -m -G [groups from user pi except for pi and sudo] username.

The -m option creates a home directory and -G [groups] option adds the user to those groups. Set up a password to the new user with

$ sudo passwd username.

After that, log out and log in to the new user account. You can find more specific steps on this website.

1

I had the same problem:

  1. check if the home folder has been created (it was missing)

  2. check the passwd file sudo nano /etc/passwd (the bash was missing)

there should be a line like this:

paolo:x:1001:1001::/home/paolo:/bin/bash

(my user is paolo)

Else try deleting and recreating the user, it worked for me!!

Hope it helps!

0

su on its own defaults to the root user. If you use su - username, then it will try to login to that user.

7
  • Thanks but that is what I did and it works. what does not work is login at boot! Commented Aug 17, 2017 at 17:31
  • Are you sure you are using the correct password?
    – user67453
    Commented Aug 17, 2017 at 17:31
  • yes that's why i tested it with su Commented Aug 17, 2017 at 17:32
  • Do you remember the exact useradd command you used?
    – user67453
    Commented Aug 17, 2017 at 17:33
  • yes. adduser newuser Commented Aug 17, 2017 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.