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. |
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.
|
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. |
anyone?
|
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. |
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. |
All times are GMT -5. The time now is 01:30 AM. |