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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
11-20-2009, 04:06 PM
|
#1
|
LQ Newbie
Registered: Nov 2009
Posts: 4
Rep:
|
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.
|
|
|
11-20-2009, 05:20 PM
|
#2
|
Member
Registered: Dec 2008
Distribution: Gentoo, Debian
Posts: 31
Rep:
|
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 05:21 PM.
|
|
|
11-20-2009, 05:28 PM
|
#3
|
LQ Newbie
Registered: Nov 2009
Posts: 4
Original Poster
Rep:
|
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.
|
|
|
11-21-2009, 08:21 AM
|
#4
|
LQ Newbie
Registered: Nov 2009
Posts: 4
Original Poster
Rep:
|
anyone?
|
|
|
11-21-2009, 07:37 PM
|
#5
|
Member
Registered: Dec 2008
Distribution: Gentoo, Debian
Posts: 31
Rep:
|
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.
|
|
|
11-22-2009, 04:32 AM
|
#6
|
LQ Newbie
Registered: Nov 2009
Posts: 4
Original Poster
Rep:
|
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 09:20 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|