Tiny Core Linux

Tiny Core Base => TCB Talk => Topic started by: code on October 13, 2017, 07:08:20 AM

Title: Update sudo version?
Post by: code on October 13, 2017, 07:08:20 AM
I'm wondering why sudo -i doesn't start a shell as root.

Code: [Select]
$ 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.

Code: [Select]
$ sudo -V
Sudo version 1.7.8p1
Title: Re: Update sudo version?
Post by: gerald_clark on October 13, 2017, 08:26:14 AM
It is busybox.
Try sudo sh
Title: Re: Update sudo version?
Post by: code on October 13, 2017, 10:48:50 AM
It doesn't appear to be busybox.

Code: [Select]
$ ls -la `which sudo`
---s-wx--x    1 root    root    154544 Sep 21 16:12 /usr/bin/sudo
Title: Re: Update sudo version?
Post by: Rich on October 13, 2017, 10:54:34 AM
Hi code
No, it does not appear to be from busybox.

To start a root shell in your current directory:
Code: [Select]
sudo sh
To start a root shell in the superusers directory (/root/):
Code: [Select]
sudo su
Title: Re: Update sudo version?
Post by: andyj on October 13, 2017, 03:36:10 PM
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?
Title: Re: Update sudo version?
Post by: code on October 16, 2017, 07:13:34 AM
Both sudo su and sudo sh do the same thing for me and neither of them bring me to /root/
Title: Re: Update sudo version?
Post by: Rich on October 16, 2017, 07:53:45 AM
Hi code
This is what I get:
Code: [Select]
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:~$
Title: Re: Update sudo version?
Post by: code on October 16, 2017, 07:55:57 AM
If I boot from the CorePure64-8.2.iso I stay in /home/tc with both commands.
Title: Re: Update sudo version?
Post by: Rich on October 16, 2017, 08:08:16 AM
Hi code
Is this only under  Qemu  or does this also happen if you boot it on bare metal?
Title: Re: Update sudo version?
Post by: patrikg on October 16, 2017, 09:36:07 AM
Try to add - to the command.

Code: (bash) [Select]
sudo su -
Title: Re: Update sudo version?
Post by: code on October 17, 2017, 08:47:15 AM
It is using QEMU. I have not tried on bare metal.
Title: Re: Update sudo version?
Post by: code on October 20, 2017, 08:57:15 AM
Is updating the sudo version possible?
Title: Re: Update sudo version?
Post by: Juanito on October 20, 2017, 11:56:54 PM
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?