LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   chown username -R / oops HELP! (https://www.linuxquestions.org/questions/linux-newbie-8/chown-username-r-oops-help-192175/)

fireman949 06-10-2004 11:59 PM

chown username -R / oops HELP!
 
Well, I think I fubar'd my webserver.

Running Slackware 9, logged in as root, wanted to change permissions on just one directory and all subdirectories.

chown {username} -R /

now every file on my server (with the exception of a few that couldn't be changed is owned by 'eric' and not root or others....

Is there any way to fix this or am I fubar?

beerwulf 06-11-2004 12:37 AM

Okay, I'm certainly no expert, and I haven't even installed Linux for the first time yet (but oh, I'm getting close!), but here's a suggestion/question.


You are Root. Can you give some kind of 'Root' permission to 'Eric', so that he is capable of doing everything that Root is (was) able to do? If so, I imagine you could then log in as Eric and set all files back to being accessable by everyone. Log back in as Root, take away the 'root' permission of Eric again.


Hope this is of some help in at least some small way. :/

Good luck.

elluva 06-11-2004 01:50 AM

pff, you can change them all back to root again (by doing chown root -R /) but then you will have to manually set the usernames correctly on all your personal folders (e.g. /home/*).

I personally wouldn't go through all that trouble ;).

motub 06-11-2004 01:54 AM

No, no-- please do not do that (referring to beerwulf's suggestion)!!!

The very point of user privilege separation is that eric should never have the permissions of root (except temporarily). This occurrence is the very reason that it is strongly suggested that one not log in as root (because it's very easy to fubar your system that way, as you now know).

Have you tried going back as root and doing a chown in reverse (using the username root instead of eric)? Can't get much worse at this point.

Wait a minute-- when you say, your server, do you mean the whole system, or are you talking about a server running on the system (which is what I assumed)?

If you mean the former, I must admit, I did this once myself, and made the system unbootable by doing so (as many system files were no longer owned by root, which they needed to be). IIrc, I solved it by doing an upgrade install over the original install to set the permissions back correctly.

Frank_Drebin 06-11-2004 07:37 AM

Well, if you change it all back you will definately need to fix your home and /tmp files. Be careful to not change the whole /tmp folder though or you will have bad bad things happen as well.

chown -R root /
chown -R eric /home/eric
chown -R eric /tmp/*-eric


Good Luck

darthtux 06-11-2004 07:06 PM

You need to change the ownership of system files back to root or nothing will work. Some files won't or aren't supposed to run as root for security purposes. There you will have to find the documentation and re-chown each individual file/folder.

beerwulf 06-11-2004 08:36 PM

Well, I did say "Log back in as Root, take away the 'root' permission of Eric again" which complies with "eric should never have the permissions of root (except temporarily)." :P

But that's neither here nor there now, especially given that it seems you can still change file permissions as Root, even if they're owned by someone else.... which actually does make a heck of a lot of sense.

Well, there you go. I'm learning. :)


All times are GMT -5. The time now is 04:44 PM.