Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: rickygai on September 11, 2009, 01:00:17 AM
-
How to configure TinyCore to boot to console mode as ROOT user ?
-
Check the boot options in the wiki.
-
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.
-
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.
-
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
-
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
-
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.
-
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.)
-
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.