User created via the installation wizard is missing.

Asked by akdriveus

I have created a custom Live ISO Ubuntu 20.04 using Cubic.
While configuring the custom ISO I've also created two users.

During the installation of the customized Ubuntu on my laptop, I created another user via the installation wizard. I selected to prompt for a password before login. After the installation was completed (without errors) I rebooted the laptop. When the OS has loaded, two users which I created in the Cubic virtual environment were listed on the login page. However, the user that I created via the installation wizard was missing.

I selected "not listed?" on the login page and entered the username of the missing user in the 'Username' field. After I pressed Enter the system started password validation before I even entered anything in the 'Password' field.

I'd like to mention that I was able to successfully install Ubuntu and create a user from the original ISO that I downloaded from the Ubuntu downloads page.

Did I miss anything while configuring this ISO in Cubic?

Question information

Language:
English Edit question
Status:
Solved
For:
Cubic Edit question
Assignee:
No assignee Edit question
Solved by:
Cubic PPA
Solved:
Last query:
Last reply:
Revision history for this message
Best Cubic PPA (cubic-wizard) said :
#1

Instead of creating the users in the Terminal environment, try preseeding the user accounts:

https://help.ubuntu.com/lts/installation-guide/s390x/apbs04.html#preseed-account

Revision history for this message
akdriveus (akdriveus) said :
#3

Thanks Cubic PPA, that solved my question.

Revision history for this message
Cubic PPA (cubic-wizard) said (last edit ):
#4

I did some experimentation, and I think the following solution works best based on your description above.

- This approach will allow you to specify a user during the installation wizard (Ubiquity) as you normally do.
- Ubiquity will also automatically create specified new users using the adduser command.
- Ubiquity will use the usermod and chpasswd commands to set each user's groups and password.
- We use the "adduser" command instead of the "useradd" command, because "adduser" is a higher level command that properly creates necessary information.
- Note that these users will not be available in Cubic's terminal environment or in the custom Live environment. The will only be available in the installed system.

Because the "d-i preseed/late_command" does not work in Ubuntu, you should use "ubiquity ubiquity/success_command" instead in your preseed file.

There may only be one "ubiquity ubiquity/success_command" section in your preseed file. Nevertheless, you can add as many users as you like using the following format, as long as you separate each user with "; \" as shown.

In the preseed commands below,...

- User One = the full name of the first user
- user_one = the user name of the first user
- password_one = the password for the first user

- User two = the full name of the second user
- user_two = the user name of the second user
- password_two = the password for the second user

If you wan to create users with passwords, add the following at the end of your ubuntu.seed file on Cubic's Options page, Preseed tab:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ubiquity ubiquity/success_command string \
    in-target adduser --disabled-password --gecos "User One,,,," user_one && \
    in-target usermod --append --groups adm,cdrom,sudo,dip,plugdev,lpadmin user_one && \
    echo "user_one:password_one" | in-target chpasswd; \
    in-target adduser --disabled-password --gecos "User Two,,,," user_two && \
    in-target usermod --append --groups adm,cdrom,sudo,dip,plugdev,lpadmin user_two && \
    echo "user_two:password_two" | in-target chpasswd;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

If you wan to create users without passwords, add the following at the end of your ubuntu.seed file on Cubic's Options page, Preseed tab:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ubiquity ubiquity/success_command string \
    in-target adduser --disabled-password --gecos "User One,,,," user_one; \
    in-target usermod --append --groups adm,cdrom,sudo,dip,plugdev,lpadmin user_one; \
    in-target adduser --disabled-password --gecos "User Two,,,," user_two && \
    in-target usermod --append --groups adm,cdrom,sudo,dip,plugdev,lpadmin user_two;
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

You can adjust the group memberships as needed. For example, you may want to add the "sambashare" group.