Tiny Core Linux
Tiny Core Base => TCB Talk => Topic started by: code on October 13, 2017, 07:08:20 AM
-
I'm wondering why sudo -i doesn't start a shell as root.
$ wget http://tinycorelinux.net/8.x/x86_64/release/CorePure64-8.2.iso
$ qemu-system-x86_64 -cdrom CorePure64-8.2.iso -m 512
# press enter for no boot codes
$ id
uid=1001(tc) gid=50(staff) groups=50(staff)
$ sudo -i
$ id
uid=1001(tc) gid=50(staff) groups=50(staff)
$
It seems the sudo version is old.
$ sudo -V
Sudo version 1.7.8p1
-
It is busybox.
Try sudo sh
-
It doesn't appear to be busybox.
$ ls -la `which sudo`
---s-wx--x 1 root root 154544 Sep 21 16:12 /usr/bin/sudo
-
Hi code
No, it does not appear to be from busybox.
To start a root shell in your current directory:
sudo sh
To start a root shell in the superusers directory (/root/):
sudo su
-
Just out of curiosity, why are the permissions on sudo 4131? And why does it seem like the rest of the executables in /usr/bin are randomly either 775 or 755 instead of all one or the other?
-
Both sudo su and sudo sh do the same thing for me and neither of them bring me to /root/
-
Hi code
This is what I get:
tc@box:~$ sudo sh --- Become root in current directory
root@box:/home/tc# exit --- Exit back to user tc
tc@box:~$ sudo su --- Become root in /root/ directory
root@box:~# ls -a --- Display contents of current directory
. .. .Xdefaults .ash_history .cache .config .local .profile
root@box:~# ls -a /root --- Display contents of /root/ directory
. .. .Xdefaults .ash_history .cache .config .local .profile
root@box:~# exit --- Exit back to user tc
tc@box:~$
-
If I boot from the CorePure64-8.2.iso I stay in /home/tc with both commands.
-
Hi code
Is this only under Qemu or does this also happen if you boot it on bare metal?
-
Try to add - to the command.
sudo su -
-
It is using QEMU. I have not tried on bare metal.
-
Is updating the sudo version possible?
-
The latest versions of sudo are much bigger.
It would probably make mores sense to look at why the existing version doesn't do what you want - perhaps a compile switch is required?