Permission issues switching drivers

Don’t know if this is the right section for this, but it started as a graphics drivers issue, so here i am.

So, I’m a total noob to manjaro, I literally just installed it yesterday, and i was setting things up, so i went to switch some of the drivers (more specifically, it was using video-linux for my nvidia graphics card, so i wanted to change that). I tried using the msm to do that easily, but it was giving me some authentication issues, and by that i mean that whenever i tried to do anything, this “authentication required” window popped up, started to shake around the screen for like 2 seconds and then disappear, to then give me the “no user input” error.

So i tried to fix this by changing a few permissions, but i messed up big time and now i can’t run any sudo command or access su - from the terminal, and i have no clue how to solve this.

sudo: /etc/sudo.conf is owned by uid 1000, should be 0
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set

This is the error i get whenever i try to run a sudo command or access su -

Any ideas?

This sounds like you’ve been bitten by the polkit issue. Strangely enough, not every Manjaro system was affected by this — it seems to have primarily occurred on systems with a kernel older than 6.12.

There are two ways you can deal with this. :backhand_index_pointing_down:

  • Either use kernel 6.12 LTS, 6.18 LTS, or a more recent and still supported mainline kernel; or…

  • Reinstate the SUID bit on /usr/lib/polkit-1/polkit-agent-helper-1:backhand_index_pointing_down:

    sudo chmod 4755 /usr/lib/polkit-1/polkit-agent-helper-1
    

However, given that you’ve broken sudo, read on… :backhand_index_pointing_down:

First of all, please list the permissions on the above two files… :backhand_index_pointing_down:

for f in /etc/sudo.conf /usr/bin/sudo ; do ls -l $f ; done

Secondly, given that we don’t know which permissions you’ve changed and which ones you haven’t, restoring a backup — or a btrfs snapshot — will probably be the best way of getting things back to normal.

If on the other hand it’s only those two files that you messed up, then we can salvage thing by way of a chroot, but I’ll explain how to do that later, depending on your reply.

-rw-r--r-- 1 myname myname 4344 14 dic 15.13 /etc/sudo.conf
-rwxr-xr-x 1 myname myname 257136 14 dic 15.13 /usr/bin/sudo

This is what i get running that.

Also yes, now that you mention it, i did switch kernel earlier, because one of my peripherals didn’t have drivers that were compatible with the newest one (although switching didn’t fix that in the end). I’m on 6.1 now, so that seems to be spot on

1 Like

If those are the only two files whose permissions and ownership you’ve changed, then boot up from the live USB, open a terminal, and issue the following command… :backhand_index_pointing_down:

sudo -i

Now, depending on whether you have btrfs or ext4 on your root filesystem, the procedure differs somewhat. And if your root filesystem is encrypted, then you must first open the encrypted container with… :backhand_index_pointing_down:

cryptsetup open -name name-of-the-container-here

As an example, I am going to assume that your root filesystem is /dev/sda2, but you should change this to what applies to your installation, and of course, whether or not you use encryption.

  • For btrfs:backhand_index_pointing_down:

    mount -t btrfs -o subvol=/@ /dev/sda2 /mnt
    
  • For ext4:backhand_index_pointing_down:

    mount -t ext4 /dev/sda2 /mnt
    

Next, issue the following commands… :backhand_index_pointing_down:

chown root:root /mnt/etc/sudo.conf
chown root:root /mnt/usr/bin/sudo && chmod 4755 /mnt/usr/bin/sudo
chmod 4755 /mnt/usr/lib/polkit-1/polkit-agent-helper-1
sync

After this, if you use encryption, you should close the container, and you can now safely reboot.

The above should also fix your issues with the authentication dialog in the manjaro-settings-manager.

Crossing your fingers may help… :stuck_out_tongue:

:crossed_fingers:

3 Likes

Well, should’ve actually crossed my fingers - because now i have a new issue.

So apparently the same live USB i used to install manjaro doesn’t work anymore…? When i boot up the UEFI, the only USB boot option is with RTK, which just ends up not booting at all. I even tried to reinstall the ISO in the USB, but the result is the same. Fast boot and secure boot are disabled too, so I’m at a loss…

Mobo is ASRock btw, just so you know what i’m working with

The easiest way to do this is with Ventoy. It doesn’t require you to “burn” the ISO to the stick. You just copy the ISO to the Ventoy folder on the stick, and it’ll give you a boot menu if you select the stick in the EFI boot options (or if your computer looks for a bootable USB before trying to boot from the internal drive).

ventoy is in the repositories, but of course, given that you’ve messed up your privilege escalation, that might not work. :face_with_diagonal_mouth:

Do you have any backups and/or btrfs snapshots?

I’m afraid I don’t know what “RTK” is. :man_shrugging:

Alright so, i tried installing ventoy on a windows laptop, and i installed it on my USB. Then, i just dragged and dropped the manjaro ISO file inside the USB, and tried to boot my pc with the USB (this is what i understood from what you said), but i get the same issue: my UEFI does detect the USB, and it gives me an option to boot through it, but then it doesn’t consider it a viable boot device (also, i only get the RTK option like i said earlier, which isn’t the option i chose to install manjaro the first time).

Before this i was installing the ISO in the USB through rufus, is there any difference using ventoy?

don’t think so. I would check, but can i do that considering I can’t sudo?

Not sure either, it’s just the only new boot option that pops up when i insert the USB. (USB:RTK)

Well, a Ventoy stick can hold multiple ISOs, and it will then allow you to choose one from a menu at boot.

If you have btrfs snapshots and grub-btrfs, then you can boot into a snapshot from the grub menu, and then you can roll back your filesystem by restoring it from the snapshot.

It’s pretty quick, because it uses the copy-on-write principle.

What does the documentation of your motherboard say? And how did you install Manjaro on that machine in the first place?

1 Like

I see, but whenever i boot i don’t get the grub menu, and from what i found to make it appear again you need to update it, which requires sudo…

I don’t think RTK is from my mobo, as it’s not always there, it appears only when i plug in the USB (also, i can’t find anything about it in my mobo user manual).

As for how i installed manjaro, like i said, i used the very same USB i’m using now. But, when you told me to try to boot from the live USB, it was only giving me the RTK option, when before, when i actually installed manjaro, it was showing me 2 other USB booting options, and one of them is the one that ended up working (i forgot what they were called exactly, probably like UEFI partition 1 and 2, and 1 was the one that worked).

After that, i tried to reinstall manjaro in the USB through rufus, and then through ventoy, like you suggested, but in both cases i only get the RTK boot option in the boot menu.

If the USB hadn’t worked the first time, i would’ve just blamed the whole thing on a faulty stick and would’ve bought a new one already, but i literally didn’t change anything on the USB from when it worked and when it didn’t, so it really doesn’t feel like that’s the case…

No, that’s just for making it permanent. But even if it’s hidden by default, pressing Esc at boot time should pop up the boot menu.


Edit: There may be another way, but it too involves getting to the boot loader menu first.

When the boot loader menu is on your screen, highlight the entry for your chosen kernel and hit E. You will then be able to edit the kernel boot line.

Move the cursor all the way to the end of the line with the boot options, enter a space, and add the word “single”. Then press F10. The machine will then start booting, and normally, it will then be booting into single-user maintenance mode, where you are root.

Then enter the commands… :backhand_index_pointing_down:

chown root:root /etc/sudo.conf
chown root:root /usr/bin/sudo && chmod 4755 /usr/bin/sudo
chmod 4755 /usr/lib/polkit-1/polkit-agent-helper-1
sync
systemctl reboot

If this works, then everything should be back to norml, including the authentication dialog.

Caveat: You’ll need some other way to get to this thread, because single-user maintenance mode is root-only and text-only, and there is no networking.

Alright, before i mess this up even further, can you tell me how to check if i have the snapshots?

From what i see in the grub menu, i can boot with a different kernel (the 16.18 i had before), nut I’m assuming this isn’t what you’re talking about.

The only other options are to just boot normally, or open the UEFI menu

1 Like

No, it isn’t, and it means you either don’t have grub-btrfs or(/and) you don’t have any snapshots.

I would try with the single-user maintenance mode as explained in (and as an addendum to) my previous post.

1 Like

That may be a good option to try :wink:

(If your installation has a root password set, you may be able to repair it without sudo from a terminal (CTRL-ALT-F3).)

yeah, that didn’t work :sweat_smile:

So i guess i need to try and see if a different USB does the trick? or do you have any other ideas?

Did you try this already ?
If it doesn’t work, what exactly doesn’t work?

2 Likes

Given that the system was installed yesterday, it can also just be reinstalled, but of course setting permission on sudo will probably be quicker.

So the real problem for me it the inability to boot from flash. And i think i have an idea what happened - Ventoy was installed in the wrong mode. There is a small menu in the ventoy installer where one can choose legacy or uefi. If it does not match what is set in the bios, it will not run. My advice is to set everything to uefi and disable csm in the bios, and then make sure ventoy is also installed as uefi.

3 Likes

I just installed a new mabox. And got the shaky root windows.

So I installed from the terminal a new kernel. Otherwise you get the shaky window.

sudo manjaro-settings-manager

I took kernel 18. The latest LTS if I am right.

Now no shaky root windows :partying_face:

1 Like

Well, in the OP’s case, the recommendation for a newer kernel was because of the polkit issue. :wink:

1 Like

I would have done that via mhwd-kernel (or pacman), rather than launching a graphical program as root.
:wink:

2 Likes