Manjaro-arm-tools creating a default user

Not sure if this is the correct section to post in, but I’m looking to create a default “admin” user when building an image with the arm-tool builder.

The goal is to have defaults already made that can be used to launch our installation script with no/little contact to the command line for our users.

My main thought is that this will require me to use the buildrootfs… but I’m curious what the best way to do this is.

Any help is appreciated!

Use the Manjaro ARM Installer for that.

The tools does not currently create any users.

From useradd -h you get

  -p, --password PASSWORD       encrypted password of the new account

To create the encrypted password you can use the Perl crypt() function

crypt($text, $salt)

So you can do

sudo useradd -m -p $(perl -e crypt("plaintextpassword", "salt") chosenusername

There is plenty results on the internet when you search for scripting useradd

2 Likes

That’s what I would assume. So I would need to utilize the buildrootfs then