[haiku-sysadmin] Re: I broke sudo on vmweb

  • From: Oliver Tappe <zooey@xxxxxxxxxxxxxxx>
  • To: haiku-sysadmin@xxxxxxxxxxxxx
  • Date: Thu, 17 Sep 2015 11:36:39 +0200

Hi,

On 09/17/2015 11:08 AM, Ingo Weinhold wrote:

On 17.09.2015 03:22, waddlesplash wrote:
Well, this is the email I hoped I would never have to write...

Drupal started giving me 'access denied' when trying to access the
admin pages, so I logged in via SSH to see what was up. I figured I'd
add kallisti5 to sudoers at the same time while I was at it.

I did try to use visudo to edit the file (after poking around and
confirming we weren't using sudoers.d or 'sudo' groups), but that just
gave me 'command not found', so I just used nano instead, which
appears to have line-wrapped the file, so sudo now chokes on it. I
then tried to use pkit to get another editor instance to fix the
problem, but it appears pkit is failing because 2FA is not fully set
up yet (or because nobody bothered to configure it in the first
place.)

You can definitely use vi to fix the file (or even back it up and
reconstruct it with cat or echo), if you still have a root shell. If
not, I guess we'll have to shut the VM down, mount the disk image
manually (or attach it to another VM?) to gain access to the FS and
replace the file. Not that I have ever done that.

A simple alternative is to login and become root on baron and then do 'virsh console vmweb' and then login as root onto the VM. I have just done that and fixed the sudoers file.

waddlesplash: visudo is installed, but it lives in /usr/sbin, so you need to use that path explicitly when invoking it via sudo.

cheers,
Oliver

Other related posts: