Ubuntu Live CD: How to switch user on LiveCD to "root"
The live CD will forget everything you did during your session, so I'd recommend booting from a USB key with a persistent session. Root has no password in live session, so in the CLI, if you do sudo su
, it'll just go to root, and not ask for a password. You could easily make a bash script to go to root and then run your perl scripts.
By default root will timeout after 15 minutes, but you can change that, see this page.
slayedbylucifer
Updated on September 18, 2022Comments
-
slayedbylucifer over 1 year
I have created my customized live CD by following the instructions @ Ubuntu Forum Thread 688872
The Live CD gets created fine and it is able to bootup as well. I see my customized setting in place.
I created the Live CD using Ubuntu 10.04 Server edition.
My issue is, when the system boots up with the live CD, it logs in automatically as "ubuntu" user. I want the system to login as "root". Because I will be running quite a few perl automation script off of the live CD and I need to have root privileges.
Now, i know the "sudo" way of doing it, But I am least bothered about the security aspect and want my system to switch to "root" user the moment it boots up.
Is there a hack to achieve the same?
UPDATE: If you cant resist to down vote my question, then please free to do so but do me a favor and let me know why you are down voting by dropping a comment.
-
Rinzwind over 11 yearsI strongly advice to find an alternate method for deploying your perl scripts. You do know that you can add post-install scripts to your live cd? (
kickstart
I think it is called). -
slayedbylucifer over 11 yearsNo, these are not post install scripts, I will running the SPECcpu test in fully automated way. these test and their iteration take 2-3 days to complete. This is a very big chunk of automation and could not be a part of "post kickstart stuff. Thanks for your time.
-
slayedbylucifer over 11 yearsalso, what's up with the down vote, what is wrong with the question, I really feeling that stackexchange should make comments mandatory while down voting someone's questions...
-
Rinzwind over 11 yearsAch @dheeraj someone will come along and upvote. I see a tendency for increased downvotes when someone asks to do anything about sudo/root. Don't bother with it since we can't stop it ;)
-
Rinzwind over 11 yearsWould it be an option to put those scripts in cron? Or to make the user
ubuntu
a sudo account with no password just for the time to run these scripts? I looked around for about an hour but gave up on setting the custom live cd to use root. It looks to much of a hassle. Setting things up post-install is probably easier. -
slayedbylucifer over 11 years@Rinzwind,I am thinking of putting my scripts in rc.local and then run them with "sudo". If not then run them via sudo in Cron. I haven't yet tried either of these. I will do the testing and will update this thread regarding which approach is working fine. Thanks for your time and cron suggestion.
-
-
slayedbylucifer over 11 yearsyeah, USB is not an option as i will be mounting my ISO via Light out console of the server programatically. Thanks for your time and the hint regarding how to increase root timeout.