0

I am trying to create a user to my system created using Yocto.

I have the following line in my recipe for my custom image:

inherit extrausers
EXTRA_USERS_PARAMS = " useradd -p 'myuser' -d /home/myuser --create-home myuser; "

The result is that I can't login as myuser, but I can change to myuser using su. What am I doing wrong?

Clifford
  • 88,407
  • 13
  • 85
  • 165
TheAG
  • 287
  • 1
  • 4
  • 10

1 Answers1

0

useradd requires some manual work. Write up done on this post.

Use adduser instead.

Flewz
  • 343
  • 9
  • Replacing useradd with adduser gives a build-time error about that line. – TheAG Dec 09 '22 at 10:16
  • @TheAG Did you only replace the command or did you look into its syntax? – Flewz Dec 09 '22 at 13:53
  • I first just replaced the command and the realized that I should have done a little more :) I then tested adduser in target system and noticed that it did what I wanted. The problem with it is that extrauser class in Yocto requires you to use useradd and not adduser. – TheAG Dec 10 '22 at 15:07