How can I have 'root' account as default when mini ubuntu boots (instead of 'ubuntu' account the system uses)

Asked by greatsouls on 2011-11-28

Hello,

You guys have done great job remastering and compiling such a small ubuntu distribution! And all the customization tools…
Thanks a lot for this :)

I have two question.

1. Currently I am trying to use Ubuntu Mini Remix 11.04 (i386) to create bootable USB key that will automatically run couple of different scripts when you boot to the key. I have been using so far SLAX and as it is using ‘root’ as default user it was easy with stuff like mounting and unmounting and creating directories. Switching to ubuntu mini now it is using ‘ubuntu’ account and all the scripts need to be corrected (added sudo in front of commands like mount). I tried to run ‘sudo su’, ‘su -s’, ‘su -i’, ‘su -u’ from inside the first script, but they switch to a different shell(may be I am wrong?) and my script stops. Ho can I overcome this?
Is it possible to modify Ubuntu Mini Remix 11.04, so it will be using ‘root’ account instead of 'ubuntu'?
If not I will need to modify all scripts (it is a lot of work!) and to add ‘sudo’ in front of each command that requires elevated permissions.
I googled for days with no avail.
Could you please point me to a source or give me an advice, please? This is really very important for me.

2. How can I run my script automatically when the system boots?
I added the full path and the script name in '/etc/rc.local', but it did not work.
Is that the correct place / way to auto run a script?

Really appreciate your advise and help.

Best regards,
greatsouls

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Mini Remix Edit question
Assignee:
No assignee Edit question
Solved by:
greatsouls
Solved:
2011-12-06
Last query:
2011-12-06
Last reply:
2011-11-29

it is surely possible to set another user name but i'm not sure if it's possible to use the root one, anyway at the moment i have no info about where to modify the iso to do that (it's not a matter of uck+umr but it's something in ubuntu init scripts)

greatsouls (etomcatsmail) said : #2

Thank you for the prompt respond.

greatsouls (etomcatsmail) said : #3

I tried to do it the way that I know works for Ubuntu installation - installed mingetty and put

'exec /sbin/mingetty --autologin root tty1'

in /etc/init/tty1.conf

This works well for regular Ubuntu installation but does not work for Live session. When booted the USB it used again 'ubuntu' user. The files tty1.conf was completely rewritten and 'ubuntu' user was set inside.So, the live session has a different mechanism from regular Ubuntu installation. After looking into initre.lz the upstart probably uses files from inside the ramdisk file.
Will continue to dig deeper... :)

If you get some more information on how the mechanism how LiveCD session works, could you please post it here or jus fir an email... I will do the same if I find more info on the process.

Thank you,

Hilbert (hilbertster) said : #4

I have not tested, but maybe it would work to change user by:

sudo uck-remaster-unpack-iso [your remix version].iso
sudo uck-remaster-unpack-initrd
cd ~/tmp/remaster-initrd/etc
nano -w casper.conf

Change
export USERNAME="ubuntu"
to
export USERNAME="root"
and save

sudo uck-remaster-pack-initrd
sudo uck-remaster-pack-iso

or something along those lines?

greatsouls (etomcatsmail) said : #5

Thank you Hilbert,

It works :)