1

I am using Linux Mint on my office laptop and there are two user accounts on it. one is the director's account and the other is mine. Although I did sudo command on the terminal before now I cant.It shows below error

chathurika@sanjayak-HP-Notebook ~ $ sudo su
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

To fix the permissions of sudo one told to Boot into single-user mode and do chmod u+s /usr/bin/sudo. I am new to these things. How to do that. Below I have mentioned OS released details

  • NAME="Linux Mint"
  • VERSION="18 (Sarah)"
  • ID=linuxmint
  • ID_LIKE=ubuntu
  • PRETTY_NAME="Linux Mint 18"
  • VERSION_ID="18"
  • HOME_URL="http://www.linuxmint.com/"
  • SUPPORT_URL="http://forums.linuxmint.com/"
  • BUG_REPORT_URL="http://bugs.launchpad.net/linuxmint/"
  • UBUNTU_CODENAME=xenial
schaiba
  • 7,631
WCM
  • 111

2 Answers2

2

Boot into single-user mode

It has not been single-user mode since 1995. You have emergency mode and rescue mode. Either will do for your purposes, as presumably chmod and sudo are on the root filesystem. (In the unlikely event that /usr is on a separate filesystem, pick rescue mode. Also pick rescue mode if in emergency mode you find that your / filesystem is mounted read-only.)

When the GRUB menu shows, select a "rescue mode" option if you have one. If you do not have one, use e to edit your normal bootstrap selection and add in a -s or a -b to the kernel command line, for rescue mode and emergency mode respectively. ⎈ Control+X boots with the edited command line, of course.

  • Do not use systemctl set-default as that makes a permanent change to how your operating system starts. You want a one-time modification, so that you can go back to bootstrapping normally thereafter with no further effort.
  • Forget about run-levels. Do not start learning about them. systemd does not have them in reality. Learn the paradigms that your operating system actually has.
  • You can use other kernel command line options such as emergency, 1, systemd.unit=emergency, single, S, and so forth. -s and -b are the most widely accepted across many system management toolsets, not just systemd, and are the original options from 1995.
  • Be aware that whatever you did to mess up sudo has probably caused further problems on your system.

Mint might provide you with a "recovery mode" GRUB menu choice. You can use this, too. It isn't any of systemd's bootstrap targets, though. (It runs a program named /lib/recovery-mode/recovery-menu via an additional systemd target set up by the friendly-recovery package.) "recovery mode" in Ubuntu and derivatives is not rescue mode.

Further reading

JdeBP
  • 68,745
0

Linux Mint 18 uses systemd as its init system. That said, you can issue a command that changes the default runlevel to single-user, somewhere this is called 'rescue' mode and it's numerically equal to 1. The command is:

systemctl set-default rescue.target

You can also issue this without the '.target' part.

Check other runlevels also:

   ┌─────────┬───────────────────┐
   │Runlevel │ Target            │
   ├─────────┼───────────────────┤
   │0        │ poweroff.target   │
   ├─────────┼───────────────────┤
   │1        │ rescue.target     │
   ├─────────┼───────────────────┤
   │2, 3, 4  │ multi-user.target │
   ├─────────┼───────────────────┤
   │5        │ graphical.target  │
   ├─────────┼───────────────────┤
   │6        │ reboot.target     │
   └─────────┴───────────────────┘
Emil
  • 1