[ubuntu-studio-devel] how can I alter the username in a live session

Len Ovens len at ovenwerks.net
Tue Feb 3 14:19:29 UTC 2015

On Tue, 3 Feb 2015, Thanassis Silis wrote:

> You mention that autologic can be disabled from the initrd - or at least that is
> what the guide states.
> Well in that case I am confused about were does initrd "jurisdiction" end and
> where does squashfs jurisdiction begins.
> Ie where are the limits between the 2, what does one setup and what does the
> other etc. Is there a guide you can point me to to understand all this?

My best answer is that I don't know  :(  I know that initrd starts 
plymouth and that initrd is gone by the time plymouth stops on a normal 
install. However, if the partition is encrypted initrd ends sooner or at 
least includes different amounts of drivers (plymouth has the benefit of 
the nvidia drivers being there). So where the switch takes place on the 
ISO may be somewhere else again... or might never really go away as the 
live image uses overlays in the file system and much of the file system is 
in memory anyway.

Studio is not a from scratch distro, in fact none of the flavours are. 
Even Kubuntu uses the stock Ubuntu base. This is a good thing for us 
considering the size of our team (one hand will do) and the amount of time 
any of us has to devote to it. We take Xubuntu and add media development 
tools, a bit of menu stuff, enough system fixes to make lowlatency audio 
work and some pretty graphics.

The people who know the most about this part of ubuntu are to be found in 
the vanilla Ubuntu forums/irc/mailing lists.

> The confusion outflows from the fact that I actually have managed to disable
> autologin (as explained in the link i provided), but from the extracted squashfs
> rather than the extracted initrd.

That makes sense too. Certainly by the time login happens the squashfs 
should already be mounted and if it contains /etc/passwd and /etc/shadow, 
that is where user and login should come from. Please note that besides 
editing those files, you would also have to edit /etc/group to make sure 
you are in the right groups as well as creating a home directory... in 
this case it would be on the USB fs itself.

The link I gave is talking about an older version too, though it does have 
later notes added to it.

> Now as far as the username is concerned, the link you provided states in bold
> that I should remember to create a user and password, but it does not say how.
> should I create a new entry in <initrd_root>/etc/passwd ? what about a password?
> should I copy a string from my host's /etc/shadow and create the new file
> <initrd_root>/etc/shadow and paste the password string in there?
> or what else??

I don't really know, it may be possible to add those files to the 
persistant part of things and have it reside in the USB fs too.

Live ISO is full of small hacks to make it work. initrd is supposed to be 
a small subset of the main system fs. The idea being that the system fs is 
changed and the initrd remade from that so both are the same. This is what 
happens on an install every time a new kernel is installed. I think this 
is also what happens when the ISO is originally made for the live version.

My sense is that if you can disable auto login in squashfs then you should 
be able to add the new user there as well. It may be simplest to change 
the the user name in passwd, group and shadow (and sudoers and whereever 
else) and then change the name of the home directory as well, or just 
point your user at the same one.

Anyway, I will think some more I have to go.

Len Ovens

More information about the ubuntu-studio-devel mailing list