password for live user account?

Asked by trav

Hi,
Thanks for a great tool - CUBIC.

I am trying to customize an Ubuntu 20.04LTS distro, from a 20.04LTS host.
I am using CUBIC, everything is working - however I cannot create a password for the 'live user' account 'ubuntu'.

I have been trying to delete/add/passwd the account in the CUBIC terminal, however it does not seem to work as once created and booted, I can login to the console with 'ubuntu' and no password.

Should I be expecting this to work, or is there a better way to achieve this?
I'm sure this worked with 18.04LTS...

Thank you again for great software.

Question information

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

When you delete/add/password, what command are you using or which files are you changing?

Revision history for this message
trav (travele75) said :
#2

Hello,
Thank you for your reply.

While in the cubic chroot i have tried updating the password with;
$ passwd
I have also tried with sudo (which gives an error)
$sudo passwd

I have also tried this with the user 'ubuntu'
$passwd ubuntu
$sudo passwd ubuntu

I have also tried to remove and then add the user 'ubuntu'
$ useradd ubuntu
$ passwd ubuntu

I then generate the ISO, write to USB (tried unetbootin and Ubuntu 'Startup Disc Creator') and boot the machine.
In all instances, I can login to a console terminal with the username 'ubuntu' without a password.

I can confirm that Ubuntu 18.04LTS does not behave like this, using the same proceedure.
18.04LTS does correctly update the 'ubuntu' account and enforces a password at boot, as expected.

All help is appreciated.

Revision history for this message
Cubic PPA (cubic-wizard) said :
#3

If you do `sudo passwd` you would be changing the password for the root user.

`useradd ubuntu; passwd ubuntu` looks like it should work, and you have indicted it ~used~ to work on 18.04.

I'll research this and back to you, but it may be a few days until I am able to respond.

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

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

Navigate to Cubic's Terminal page.

The vmlinuz and initrd files are missing from /boot, so install them.

$ apt install --reinstall linux-headers-5.4.0-26 linux-headers-5.4.0-26-generic linux-image-5.4.0-26-generic

$ rm /usr/share/initramfs-tools/scripts/casper-bottom/15autologin

$ rm /usr/share/initramfs-tools/scripts/casper-bottom/25adduser

$ nano /etc/gdm3/custom.conf

  Replace...
    - - - - - - - - - - - - - - - - - - - - - - -
    # Enabling automatic login
    # AutomaticLoginEnable = true
    # AutomaticLogin = user1
    - - - - - - - - - - - - - - - - - - - - - - -

  With...
    - - - - - - - - - - - - - - - - - - - - - - -
    # Enabling automatic login
    AutomaticLoginEnable = false
    AutomaticLogin = user1
    - - - - - - - - - - - - - - - - - - - - - - -

$ adduser ubuntu

    - - - - - - - - - - - - - - - - - - - - - - -
    Enter password, user name, etc.
    - - - - - - - - - - - - - - - - - - - - - - -

$ update-initramfs -u
    - - - - - - - - - - - - - - - - - - - - - - -
    Generating /boot/initrd.img-5.4.0-26-generic
    ...
    - - - - - - - - - - - - - - - - - - - - - - -

Be sure to select the kernel from the 1st step (5.4.0-26) on Cubic's ISO Kernel tab.

Generate your custom ISO image.

Revision history for this message
Cubic PPA (cubic-wizard) said :
#5

(Note: You don't need the Preseed guide I had linked to above).

Revision history for this message
trav (travele75) said :
#6

Hello,
Thank you for the information.

I followed your instructions, however it did not work (the 'ubuntu' user could still login without a password).
I did notice an error while running 'update-initramfs -u':
    cryptsetup: ERROR: Couldn't resolve device /dev/mapper/vgubuntu-root

I went back, removed cryptsetup and then generated a new ISO, which has worked.
    apt-get remove cryptsetup
I am not sure if this is expected behaviour, but it works for me.

The user 'ubuntu' now has a password prompt at login.
Thank you again for your help and a great tool.

Revision history for this message
Cubic PPA (cubic-wizard) said :
#7

I did get the following errors:
    cryptsetup: ERROR: Couldn't resolve device tmpfs
    cryptsetup: WARNING: Couldn't determine root device

On my system, this did not impact the solution working. (I tested the generated ISO in VirtualBox).

Nevertheless, thanks for pointing this out... Some users may need to remove cryptsetup, as you did.

Also, `update-initramfs -u` updates initrd for the current running. If anyone is customizing a different kernel, you will need to make sure you run `update-initramfs` for that specific kernel, and make sure you select that kernel on Cubic's ISO Kernel page.