LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 11-20-2009, 03:06 PM   #1
myretribution79
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Rep: Reputation: 0
Lightbulb su: cannot set groups: Operation not permitted


Hi all. This is my first post.

Yesterday I used chown to change every file and folder from /var/www/mysite to my user, but instead of typing * I typed /* and i chowned all my folder/files from /bin to /proc to this user instead of root or whatever user it was before.

Now I can't su - into the system or sudo.

When I use su - it throws "su: cannot set groups: Operation not permitted" and if I sudo it says "sudo: /etc/sudoers is owned by uid 500, should be 0"

What I tried so far is:
chmod ugo+s /etc/passwd
chmod ugo+s /etc/group
chmod ugo+s /bin/su

chmod 4755 /etc/passwd
chmod 4755 /etc/group
chmod 4755 /bin/su

Please help. I'm desperate.

Thank you.
 
Old 11-20-2009, 04:20 PM   #2
sarum1990
Member
 
Registered: Dec 2008
Distribution: Gentoo, Debian
Posts: 31

Rep: Reputation: 21
for starters, since you own everything, I'd recommending changing the ownership of everything in etc to root, as it usually is. After that you should at least be able to sudo again. sifting through the rest of your system for permissions will be more tricky. On my system there is only one file, mpd.conf, in my /etc directory that isn't owned by root so this should be a good start. If that fails you'll have to start up a recovery cd, like the one you used to install linux to fix the problem.

Last edited by sarum1990; 11-20-2009 at 04:21 PM.
 
Old 11-20-2009, 04:28 PM   #3
myretribution79
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Original Poster
Rep: Reputation: 0
but that's the problem.

nothing seems to work

-bash-3.2$ chown root:root /etc
chown: changing ownership of `/etc': Operation not permitted


BTW, it's a centos 5.4 server installation and it's an actual live dedicated server on which I connect with putty.
 
Old 11-21-2009, 07:21 AM   #4
myretribution79
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Original Poster
Rep: Reputation: 0
anyone?
 
Old 11-21-2009, 06:37 PM   #5
sarum1990
Member
 
Registered: Dec 2008
Distribution: Gentoo, Debian
Posts: 31

Rep: Reputation: 21
The next step would usually be booting to a livecd and mounting your hardrive after you boot, then, since your just mounting your local filesystem on an unbroken system you should be able to change the permissions. Most livecds have a rescue functionality which will drop you into a terminal as root, from which you should be able to change the permissions.

Hope this helps.
 
Old 11-22-2009, 03:32 AM   #6
myretribution79
LQ Newbie
 
Registered: Nov 2009
Posts: 4

Original Poster
Rep: Reputation: 0
Thanx for the replies.

Like I said, it's a dedicated server. So I can't use any CD/DVD, since I'm thousand of kilometers away from the server

Anyway, I asked my hosting company to reload the OS, because even if I change all the permissions to root it still won't work properly because not all files/folders need to be owned by root.
 
  


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
Warning: GDB: Failed to set controlling terminal: Operation not permitted dschornack Programming 0 08-04-2009 07:14 PM
su: cannot set groups: Operation failed TONYSUCCAR Linux - Server 1 01-23-2009 08:54 AM
su: cannot set groups: Operation not permitted mfb Linux - Security 10 12-04-2008 04:17 AM
SET failed / operation not permitted hattrick Linux - Networking 1 11-30-2008 09:20 PM
Canīt set DMA : HDIO_SET_DMA failed: Operation not permitted tiuz Linux - Hardware 13 03-17-2006 11:38 AM


All times are GMT -5. The time now is 05:37 PM.

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