0

Web search found How can I change my own user ID?. However there is no 999 (ubuntu) user in /etc/passwd in distro iso file (in casper/filesystem.squashfs), home folder is empty. AFAIK it means live user is created on-the-fly during boot.

Where and how to change that user id on iso? Not after boot, I want to modify iso file for it to boot with 1000 uid, I know how to rebuild liveUSB iso file.

P.S. checked that on latest 20.04.3 version.

1 Answers1

0

One can use custom init script. Changing grub.cfg and/or isolinux.cfg, line which usually have quiet splash -- changing to quiet splash init=/boot/abc.sh --, where /boot/abc.sh is script with contents:

#!/bin/bash
groupmod --gid 1000 ubuntu
usermod --uid 1000 ubuntu
exec /sbin/init

That script is expected to run after initrd scripts that make live user but before user login.