You are not logged in.

#1 2018-09-24 07:56:52

valgio
Member
Registered: 2017-11-30
Posts: 18

[Solved] Change permissions on /usr/bin/sudo

Hi everyone
I'm linux user for just a year...
I did a mistake:

I run this command

 sudo chmod -R 775 /usr/bin 

with result, when i type sudo [command]:

 sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set 
 ls -l /usr/bin/sudo
-rwxrwxrwx 1 root root 136496 Sep 13 11:34 /usr/bin/sudo

Now, if i try to use su command to get a root shell it gives me an Authentication failure.
I figured out two ways to proceed:
1) Get a live boot OS, mount file system and set the parameters correctly
2) Find a way to log as root ( recovery mode maybe ? )

Before do more damages I ask you if u have a better solution.

Just to know, i'm using linux just to learn how it works so this situation, from a different view, fit well

thank you in advance smile smile

EDIT: Yes i used chmod with -R flag

Last edited by valgio (2018-09-30 11:34:46)

Offline

#2 2018-09-24 11:03:38

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: [Solved] Change permissions on /usr/bin/sudo

su - and reinstall all packages that owns files in there? `pacman -Qoq /usr/bin | pacman -S -`

I'm curious as for why you were trying to change permissions on things in /usr by hand to begin with though.

Edit: hmm reinstalling the packages will probably just complain about the permission, boot install image, delete the content and then reinstall perhaps?

Edit2: I assume you did it recursively and didn't just change the permission on the dir itself.

Last edited by Mr.Elendig (2018-09-24 11:10:53)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2018-09-24 11:31:40

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

Re: [Solved] Change permissions on /usr/bin/sudo

Please edit your topic title to actually describe your issue: https://wiki.archlinux.org/index.php/Co … ow_to_post


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 2018-09-26 19:03:15

zw963
Member
Registered: 2018-06-18
Posts: 213

Re: [Solved] Change permissions on /usr/bin/sudo

My arch linux "/usr/bin" status as follow:


Access: (0755/drwxr-xr-x)  Uid: (    0/    root)   Gid: (    0/    root)

so, maybe you can boot with arch CD, and run following code to restore it to default.

# chmod 0755 /usr/bin
# chown root:root /usr/bin

Offline

#5 2018-09-26 22:36:44

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,238
Website

Re: [Solved] Change permissions on /usr/bin/sudo

 sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set 

If that is the error you're getting, then this isn't the command you ran:

 sudo chmod 775 /usr/bin 

What did you actually do? I'm guessing there was a -R flag to the chmod?

Most things in /usr/bin/ are 755. This might help you:

cd /usr/bin
find ./ -type d | xargs chmod 755
find ./ -type f | xargs chmod 755
chmod u+s sudo su mount umount sg pkexec ping passwd newuidmap newgrp newgidmap ksu gpasswd fusermount expiry chsh chfn chage unix_chkpwd
chmod g+s wall write locate unix_chkpwd

Untested, use at your own risk, etc.

Last edited by fukawi2 (2018-09-26 22:38:28)

Offline

#6 2018-09-28 15:58:22

DarthMucus
Member
Registered: 2018-08-28
Posts: 19

Re: [Solved] Change permissions on /usr/bin/sudo

Why is it not possible to switch to a different tty and login as root from there?

Offline

#7 2018-09-30 11:33:27

valgio
Member
Registered: 2017-11-30
Posts: 18

Re: [Solved] Change permissions on /usr/bin/sudo

First of all: thank you to everyone for help!!
I changed title and correct the command

I solved the problem switching on different tty and login as root

As i told I'm new on archlinux and I didn't think about this very easy solution

Thank you all again

Offline

Board footer

Powered by FluxBB