WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

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

Offline code

  • Newbie
  • *
  • Posts: 22
Update sudo version?
« on: October 13, 2017, 10: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: 4254
Re: Update sudo version?
« Reply #1 on: October 13, 2017, 11:26:14 AM »
It is busybox.
Try sudo sh

Offline code

  • Newbie
  • *
  • Posts: 22
Re: Update sudo version?
« Reply #2 on: October 13, 2017, 01:48:50 PM »
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

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11704
Re: Update sudo version?
« Reply #3 on: October 13, 2017, 01:54:34 PM »
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

  • Hero Member
  • *****
  • Posts: 1036
Re: Update sudo version?
« Reply #4 on: October 13, 2017, 06: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

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

Offline Rich

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

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

Offline Rich

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

Offline patrikg

  • Wiki Author
  • Hero Member
  • *****
  • Posts: 723
Re: Update sudo version?
« Reply #9 on: October 16, 2017, 12:36:07 PM »
Try to add - to the command.

Code: (bash) [Select]
sudo su -

Offline code

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

Offline code

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

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14851
Re: Update sudo version?
« Reply #12 on: October 21, 2017, 02:56:54 AM »
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?