Customize default user and password on TorizonCore image

Dear community,

I’m looking for a way to change the default username and password on the base image. When using SSH to login, the default username and password is set to “torizon” and on the first login there is a prompt to change the password. What I would like to have is a default user with a custom name and password built straight into the image. I would also like to add another user prior to building the image.
Is there a way to do this in the TorizonCore builder yaml customization file, or what would be the optimal way to do it? Using filesystem customization and changing rootfs comes to mind, but maybe there is a simpler way to do this.

I’ve managed to partially solve this issue by adding/replacing files to the filesystem. Using the tcbuild.yaml script I added rootfs_changes with /usr/etc and used custom passwd, shadow and group files.
I still need to add the user dirirectory to the /home directory, but this is not working for some reason. I can see that home dir is actually a symbolic link to /var/rootdirs/home, but any change I make on this path does not get built into the final image. What it the proper way to change the contents of /home directory during the build?

EDIT: I’ve realized that the /home directory is not tracked, but I still need to find a way to add a new user directory there together with .ssh and authorized_keys file.

If anyone finds this useful, a workaround can be made by specifying a different path for user home directory in passwd file. This solved the problem for me.

Hi @Marin,

I am looking to do the same thing with my Colibri. I know it’s been quite a while since you did this but is there anyway you could go into a little more depth on how you achieved it? e.g. what specific changes you made to tcbuild.yaml and how you set up your custom files etc.

Any info you are able to provide on this would be greatly appreciated!

Cheers,
Neil

Hello @Neilm,

You will have to build a custom torizon image for setting a different default username and password. Please have a look at this thread where this topic is discussed: Build Torizon OS with custom username and password - #7 by jeremias.tx

Hi @rudhi.tx,

Thanks so much for the quick response and the link. I will look into this solution as an option.

Cheers,
Neil