You are not logged in.

#1 2022-03-13 10:39:14

jc@arch
Member
Registered: 2021-06-04
Posts: 6

[SOLVED] /etc/sudoers file deleted

Hi everyone, noob here.

This morning i merged /etc/sudoers and /etc/sudoers.pacnew with 'sudo pacdiif'.
I believed the merge preserve my user. Unfortunately not.

So now i can't 'visudo'.
i can't 'sudo'
i can't log as root('su') because i disabled the root account...

how can i fix my mistake ?

thanks

Last edited by jc@arch (2022-03-13 11:16:38)

Offline

#2 2022-03-13 10:53:29

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] /etc/sudoers file deleted

Try booting to rescue.target.
https://wiki.archlinux.org/title/System … _boot_into
Either that or boot with the install media and edit the file from there.

You should always manually inspect every .pacnew merge. If there was no difference in the file to be replaced then a .pacnew wouldn't have been created in the first place.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2022-03-13 11:05:34

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,592
Website

Re: [SOLVED] /etc/sudoers file deleted

If you have polkit installed and your user is configured as an administrator (i.e. in the wheel group by default), you may be able to use pkexec to run visudo as root.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2022-03-13 11:15:17

jc@arch
Member
Registered: 2021-06-04
Posts: 6

Re: [SOLVED] /etc/sudoers file deleted

it worked. lesson learned !

pkexec pacman -S vi

pkexec visudo

thanks.

Offline

Board footer

Powered by FluxBB