LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 03-09-2012, 03:08 AM   #1
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 270
Blog Entries: 2

Rep: Reputation: 48
Linux AMI - Error: sudo: must be setuid root


I am using Amazon Linux AMI. I do not have password of root. I am just a user.
I was executing commands using sudo. It did not ask me any password and command was executed fine.
Ex- sudo rm -r /home/username/directoryname
or sudo yum install software-name
and it was working fine.
But unfortunately I have set permission of /usr/bin is 777 (drwxrwxrwx).
that is why permission of /usr/bin/sudo is become 777 (-rwxrwxrwx).
Now when I am using any sudo command , I get an error
Code:
sudo: must be setuid root
whenever i use sudo, it says
Code:
sudo: must be setuid root
now i am not able to change permission of any file. it says
Code:
chmod: changing permissions of `filename': Operation not permitted
I do not have root password. even I am not permitted to see root directory.
Please solve this problem. I am not able to execute any command now.
 
Old 03-10-2012, 02:48 PM   #2
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,218

Rep: Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474
Quote:
Originally Posted by pavi_kanetkar View Post
I am using Amazon Linux AMI. I do not have password of root. I am just a user. I was executing commands using sudo. It did not ask me any password and command was executed fine. Ex- sudo rm -r /home/username/directoryname or sudo yum install software-name and it was working fine.

But unfortunately I have set permission of /usr/bin is 777 (drwxrwxrwx). that is why permission of /usr/bin/sudo is become 777 (-rwxrwxrwx). Now when I am using any sudo command , I get an error
Code:
sudo: must be setuid root
whenever i use sudo, it says
Code:
sudo: must be setuid root
now i am not able to change permission of any file. it says
Code:
chmod: changing permissions of `filename': Operation not permitted
I do not have root password. even I am not permitted to see root directory. Please solve this problem. I am not able to execute any command now.
Without the root password, the only possibility you have is to boot the machine into single-user mode, or via a rescue CD/DVD, and change permissions back. If you tried to Google for the error, you'd have found LOTS of information...some, even on this very site:
https://www.linuxquestions.org/quest...d-root-854117/

If you can't change permissions on a file, and you can't get root access or boot from CD/DVD, your only other hope is to restore that directory from backups, and exercise some caution in the future. That's why you should NEVER play around with root or sudo access, to avoid situations like this.
 
Old 03-21-2012, 01:05 AM   #3
fortran
Member
 
Registered: Nov 2011
Location: Cairo, Egypt
Distribution: CentOS, RHEL, Fedora
Posts: 270
Blog Entries: 2

Original Poster
Rep: Reputation: 48
Quote:
Originally Posted by TB0ne View Post
Without the root password, the only possibility you have is to boot the machine into single-user mode, or via a rescue CD/DVD, and change permissions back. If you tried to Google for the error, you'd have found LOTS of information...some, even on this very site:
https://www.linuxquestions.org/quest...d-root-854117/
If you can't change permissions on a file, and you can't get root access or boot from CD/DVD, your only other hope is to restore that directory from backups, and exercise some caution in the future. That's why you should NEVER play around with root or sudo access, to avoid situations like this.
I have said in my first line that "I do not have password of root. I am just a user." Please read it again.
If I would be root. I would not execute command using sudo and the problem will be solved long before posting here.
 
Old 03-21-2012, 09:45 AM   #4
TB0ne
Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 14,218

Rep: Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474Reputation: 2474
Quote:
Originally Posted by pavi_kanetkar View Post
I have said in my first line that "I do not have password of root. I am just a user." Please read it again.
If I would be root. I would not execute command using sudo and the problem will be solved long before posting here.
Please read my reply, again:
Quote:
Originally Posted by TB0ne
Without the root password, the only possibility you have is to boot the machine into single-user mode, or via a rescue CD/DVD, and change permissions back. If you tried to Google for the error, you'd have found LOTS of information...some, even on this very site:

If you can't change permissions on a file, and you can't get root access or boot from CD/DVD, your only other hope is to restore that directory from backups, and exercise some caution in the future. That's why you should NEVER play around with root or sudo access, to avoid situations like this.
See the VERY FIRST part??...yes, I know you don't have the root password, and said that. After that, I gave you the options that you've got to GET the root password back, and change the permissions back on those files. And AGAIN, if you can't get root or boot to recovery mode, then restore the directory from backups, which will put the files/permissions back like they were.

So, you've been told:
  1. Boot to single-user mode, and change the permissions there
  2. Boot from CD/DVD into rescue mode, and change the permissions there
  3. Restore from backups
Those are your options, which you apparently missed the first time.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
sudo: must be setuid root mswamy78 Linux - Newbie 23 11-23-2012 09:20 AM
[SOLVED] sudo:must be setuid root rahulkya Linux - Software 7 02-21-2011 03:25 PM
Sorry, sudo must be setuid root kurtdriver Fedora 6 10-22-2008 07:47 PM
sudo stopped working: "must be setuid root" quincy_the_penquin Linux - Software 4 04-30-2007 06:37 AM
MDK 9.1: sound works though not in games, artswapper error need setuid root + other lhaman Linux - Distributions 0 04-02-2003 03:24 AM


All times are GMT -5. The time now is 07:48 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration