WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: How to configure TinyCore to boot to console mode as ROOT user ?  (Read 6928 times)

Offline rickygai

  • Newbie
  • *
  • Posts: 3
How to configure TinyCore to boot to console mode as ROOT user ?
« on: September 11, 2009, 01:00:17 AM »
How to configure TinyCore to boot to console mode as ROOT user ?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: How to configure TinyCore to boot to console mode as ROOT user ?
« Reply #1 on: September 11, 2009, 01:18:54 AM »
Check the boot options in the wiki.

Offline rickygai

  • Newbie
  • *
  • Posts: 3
Re: How to configure TinyCore to boot to console mode as ROOT user ?
« Reply #2 on: September 11, 2009, 02:31:22 AM »
i understand that is options to type in and enter into console mode
but i need a way to autologin as ROOT user instead of "sudo su"
each time i logged in.

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: How to configure TinyCore to boot to console mode as ROOT user ?
« Reply #3 on: September 11, 2009, 11:59:17 AM »
So you mean without entering the "superuser" boot option? The /root/.profile file controls this feature. It will autologin as root if the /etc/sysconfig/superuser file is present, so there are multiple ways to achieve this:

1) If you don't already have a backup file, then execute the following

touch /etc/sysconfig/superuser
tar czf mydata.tgz /etc/sysconfig/superuser

Place the mydata.tgz in the appropriate location so it will be loaded automatically.

2) If you already have a backup file, then boot with the superuser boot option, add the following line to your /opt/.filetool.lst, and create a backup:

etc/sysconfig/superuser

3) Create a pseudo-extension (requires squashfs-tools extension to be loaded):

cd /tmp
mkdir -p superuser/etc/sysconfig/
touch superuser/etc/sysconfig/superuser
mksquashfs superuser superuser.tcz

Place superuser.tcz in the appropriate location so it will be loaded automatically.

4) Add this line to the top of /opt/bootlocal.sh (may not work due to timing)
touch /etc/config/superuser

If you need help understanding the backup file mydata.tgz or help creating extensions, the wiki can explain or you can ask here.

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: How to configure TinyCore to boot to console mode as ROOT user ?
« Reply #4 on: September 11, 2009, 04:54:15 PM »
If you are referring to the graphical terminal window instead of the text console, the easiest way I've found to do this is to add an additional icon for aterm to login as root. To do this, you need to modify /usr/local/tce.wbar. Again, there are multiple ways to do this. The simplest is to modify the existing file and it to your /opt/.filetool.lst. Add these three lines to tce.wbar:

i: /usr/share/wbar/aterm.png
t: Root
c: exec sudo /usr/bin/aterm

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: How to configure TinyCore to boot to console mode as ROOT user ?
« Reply #5 on: September 11, 2009, 07:40:57 PM »
Quote
So you mean without entering the "superuser" boot option? The /root/.profile file controls this feature. It will autologin as root if the /etc/sysconfig/superuser file is present, so there are multiple ways to achieve this:
Keep in mind that it is no longer used (by default) in 'recent' TC releases

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: How to configure TinyCore to boot to console mode as ROOT user ?
« Reply #6 on: September 13, 2009, 05:28:17 PM »
Quote
Keep in mind that it is no longer used (by default) in 'recent' TC releases

I checked /root/.profile in 2.3 and it has:

if [ ! -f /etc/sysconfig/superuser ]; then
...
fi

That's how I figured out the simplest way to make a "persistent" superuser login was to simply use an extension or backup to create the /etc/sysconfig/superuser file. It's handy if you boot from the iso or otherwise original source without grub or syslinux.cfg to pass options automatically.

Offline ^thehatsrule^

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 1726
Re: How to configure TinyCore to boot to console mode as ROOT user ?
« Reply #7 on: September 13, 2009, 08:20:20 PM »
Ok, but I think the auto root shell login does not happen by default anymore.  Perhaps it still does occur somewhere... did you try your steps on 2.3* ?
(fyi, I'm basing this on rungetty's autologin.)

Offline danielibarnes

  • Hero Member
  • *****
  • Posts: 548
Re: How to configure TinyCore to boot to console mode as ROOT user ?
« Reply #8 on: September 14, 2009, 11:00:56 AM »
Ah, I see what you mean. /etc/init.d/tc-config has:

sed -i 's/root/'"$USER"'/' /etc/inittab

which means it will autologin as the tc user unless the superuser boot parameter is explicitly specified. Well, I guess that pretty much makes my hack useless on 2.3. :) I guess if one wants "persistent" boot options, hacks are not an option. One should use the standard grub or syslinux methods.