WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Update sudo version?  (Read 441 times)

Offline code

  • WikiUser
  • *
  • Posts: 18
Update sudo version?
« on: October 13, 2017, 06: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

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4249
Re: Update sudo version?
« Reply #1 on: October 13, 2017, 07:26:14 AM »
It is busybox.
Try sudo sh

Offline code

  • WikiUser
  • *
  • Posts: 18
Re: Update sudo version?
« Reply #2 on: October 13, 2017, 09: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

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5470
Re: Update sudo version?
« Reply #3 on: October 13, 2017, 09: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

Offline andyj

  • Sr. Member
  • ****
  • Posts: 485
Re: Update sudo version?
« Reply #4 on: October 13, 2017, 02: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?

Offline code

  • WikiUser
  • *
  • Posts: 18
Re: Update sudo version?
« Reply #5 on: October 16, 2017, 06:13:34 AM »
Both sudo su and sudo sh do the same thing for me and neither of them bring me to /root/

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5470
Re: Update sudo version?
« Reply #6 on: October 16, 2017, 06: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:~$

Offline code

  • WikiUser
  • *
  • Posts: 18
Re: Update sudo version?
« Reply #7 on: October 16, 2017, 06:55:57 AM »
If I boot from the CorePure64-8.2.iso I stay in /home/tc with both commands.

Online Rich

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 5470
Re: Update sudo version?
« Reply #8 on: October 16, 2017, 07:08:16 AM »
Hi code
Is this only under  Qemu  or does this also happen if you boot it on bare metal?

Offline patrikg

  • Sr. Member
  • ****
  • Posts: 287
Re: Update sudo version?
« Reply #9 on: October 16, 2017, 08:36:07 AM »
Try to add - to the command.

Code: (bash) [Select]
sudo su -

Offline code

  • WikiUser
  • *
  • Posts: 18
Re: Update sudo version?
« Reply #10 on: October 17, 2017, 07:47:15 AM »
It is using QEMU. I have not tried on bare metal.

Offline code

  • WikiUser
  • *
  • Posts: 18
Re: Update sudo version?
« Reply #11 on: October 20, 2017, 07:57:15 AM »
Is updating the sudo version possible?

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 9607
Re: Update sudo version?
« Reply #12 on: October 20, 2017, 10: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?