You are not logged in.

#1 2015-12-27 08:20:13

V Dev
Member
Registered: 2015-12-27
Posts: 8

Unable to run sudo after base install

Hello friends,

I am new to arch but not new to world of gnu/linux. I have installed and used distros from ubuntu to slackware and comfortable at cli.
Now I wanted to try my hands at arch.
I followed arch wiki and installed base system twice on the actual hard disk twice first with archlinux-2015.07.01-dual.iso and then with archlinux-2015.12.01-dual.iso in 64 bit mode and then once in virtualbox with archlinux-2015.12.01-dual.iso.
While i was able to run sudo somehow in virtualbox installation though I did not do anything which I think i missed in physical installs, i fail to get it working on physical disk installs.

Following is the message I get right after installing sudo and running it as non-root user with entry for user in /etc/sudoers and even as root I get the same dump.

sudo: unable to stat /etc/sudoers: Permission denied
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin


I have checked /etc/sudoers file's permissions. It is 440.
What am I missing here?

Thanks in advance.

Offline

#2 2015-12-27 08:48:21

ua4000
Member
Registered: 2015-10-14
Posts: 566

Re: Unable to run sudo after base install

To be sure: you have installed the "sudo" package ?
I have followed https://wiki.archlinux.org/index.php/Sudo - and it works.

Offline

#3 2015-12-27 09:51:55

V Dev
Member
Registered: 2015-12-27
Posts: 8

Re: Unable to run sudo after base install

It's not possible to get these errors from sudo without having it installed.
The only thing I can remember I did different in VirtualBox install was there i installed only the base package not base-devel which installs sudo by itself.
Something to do with that (although it must not matter)?

Offline

#4 2015-12-27 10:59:04

aiBo
Member
Registered: 2010-11-10
Posts: 50

Re: Unable to run sudo after base install

What are the permissions for / and /etc?

Offline

#5 2015-12-27 11:36:59

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: Unable to run sudo after base install

aiBo wrote:

What are the permissions for / and /etc?

And the sudo executable?

Offline

#6 2015-12-27 16:35:32

V Dev
Member
Registered: 2015-12-27
Posts: 8

Re: Unable to run sudo after base install

The permissions for / is 700 and it is not getting changed with 'chmod 755 /'  as root.  What can I do? Btw sudo is executable.

Offline

#7 2015-12-27 16:44:54

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,742

Re: Unable to run sudo after base install

V Dev wrote:

The permissions for / is 700 and it is not getting changed with 'chmod 755 /'  as root.  What can I do? Btw sudo is executable.

Is the SUID bit set?  It should be.

ewaller@turing ~ 1018 %ls -ln $(which sudo) 
-rwsr-xr-x 1 0 0 126160 Nov  2 23:01 /usr/bin/sudo

Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way

Offline

#8 2015-12-27 16:58:44

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,734
Website

Re: Unable to run sudo after base install

@OP - What if you simply reinstall the sudo package?

Offline

#9 2015-12-27 18:25:24

jasonwryan
Anarchist
From: .nz
Registered: 2009-05-09
Posts: 30,426
Website

Re: Unable to run sudo after base install

Not an Installation issue, moving to NC...


Arch + dwm   •   Mercurial repos  •   Surfraw

Registered Linux User #482438

Offline

#10 2015-12-27 18:26:07

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

Re: Unable to run sudo after base install

V Dev wrote:

The permissions for / is 700 and it is not getting changed with 'chmod 755 /'  as root.  What can I do? Btw sudo is executable.

What filesystem is /?


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

#11 2015-12-27 18:37:14

shulamy
Member
From: israel
Registered: 2010-09-11
Posts: 470

Re: Unable to run sudo after base install

i changed the permission, added myself to sudoers and changed the permission back.

ezik

Offline

#12 2015-12-27 19:59:52

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

Re: Unable to run sudo after base install

shulamy wrote:

i changed the permission, added myself to sudoers and changed the permission back.

ezik

Wrong thread?


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

#13 2015-12-28 06:10:34

shulamy
Member
From: israel
Registered: 2010-09-11
Posts: 470

Re: Unable to run sudo after base install

why?

V Dev wrote:

sudo: unable to stat /etc/sudoers: Permission denied
sudo: no valid sudoers sources found, quitting
sudo: unable to initialize policy plugin

ezik

Offline

#14 2015-12-28 14:14:03

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Unable to run sudo after base install

Please paste the output of

ls -ld $(which sudo) / /etc /etc/sudoers

pkgs │ hacks │ cfg │ blag

Offline

#15 2015-12-28 15:05:30

V Dev
Member
Registered: 2015-12-27
Posts: 8

Re: Unable to run sudo after base install

ayekat wrote:

Please paste the output of

ls -ld $(which sudo) / /etc /etc/sudoers

The output for the above is as under

drwx------ 18 755 root   4096 Dec 28 20:24 /
drwxr-xr-x 39 755 root   4096 Dec 27 15:35 /etc
-r--r-----  1 755 root   3174 Nov  3 12:31 /etc/sudoers
-rwxr-xr-x  1 755 root 126160 Nov  3 12:31 /usr/bin/sudo


Btw I have tried reinstalling already before i posted the issue here but in vain.

Offline

#16 2015-12-28 15:15:28

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Unable to run sudo after base install

This would answer ewaller's question about the SUID being set, then. Have you tried setting it (as root)?

chmod u+s /usr/bin/sudo

Although... it's weird that a re-installation of sudo wouldn't fix the permissions on the sudo executable.

(if setting SUIDs doesn't work, then an answer to WorMzy's question would be helpful)

WAIT, WAIT, WAAAAAIT. Did you chown instead of chmod? The owner of the files seems to be 755.
Something, somewhere has gone terribly wrong.

Last edited by ayekat (2015-12-28 15:18:16)


pkgs │ hacks │ cfg │ blag

Offline

#17 2015-12-28 17:10:07

V Dev
Member
Registered: 2015-12-27
Posts: 8

Re: Unable to run sudo after base install

ayekat wrote:

This would answer ewaller's question about the SUID being set, then. Have you tried setting it (as root)?

chmod u+s /usr/bin/sudo

Although... it's weird that a re-installation of sudo wouldn't fix the permissions on the sudo executable.

(if setting SUIDs doesn't work, then an answer to WorMzy's question would be helpful)

WAIT, WAIT, WAAAAAIT. Did you chown instead of chmod? The owner of the files seems to be 755.
Something, somewhere has gone terribly wrong.


My situation can be summed up possibly as FUBAR. sad
I had run chown recursively on /
My only way out seems fresh base install.

Btw I am able to run sudo now.

But having run chown -R root:root /  and chmod - R 0755 /  nothing perhaps can salvage this installation now.

Offline

#18 2015-12-28 17:19:00

V Dev
Member
Registered: 2015-12-27
Posts: 8

Re: Unable to run sudo after base install

V Dev wrote:

My situation can be summed up possibly as FUBAR. sad
I had run chown recursively on /
My only way out seems fresh base install.

Btw I am able to run sudo now.

But having run chown -R root:root /  and chmod - R 0755 /  nothing perhaps can salvage this installation now.

Isn't it right that I would be so much better off with a new install rather than try to fix this esp.  with so may folders' and files' ownership and permissions that would be needed to be rectified?

Offline

#19 2015-12-28 17:24:35

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Unable to run sudo after base install

V Dev wrote:

But having run chown -R root:root /  and chmod - R 0755 /  nothing perhaps can salvage this installation now.

I guess you've learned a lesson here: Never recursively do anything in /. smile

And yes, I'd say fingering around on that system any longer might be considered necrophilia at best.


pkgs │ hacks │ cfg │ blag

Offline

#20 2015-12-28 17:34:45

V Dev
Member
Registered: 2015-12-27
Posts: 8

Re: Unable to run sudo after base install

Thank you all for your help. Going to reinstall base.

Offline

Board footer

Powered by FluxBB