Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 06-11-2004, 12:59 AM   #1
Registered: Dec 2003
Location: Walls
Distribution: Slackware 10.1;CentOS 4
Posts: 51

Rep: Reputation: 15
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?
Old 06-11-2004, 01:37 AM   #2
LQ Newbie
Registered: Apr 2004
Location: Australia
Distribution: SuSE 9.0 'Technology Evaluation'
Posts: 10

Rep: Reputation: 0
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.
Old 06-11-2004, 02:50 AM   #3
Registered: Aug 2003
Location: Belguim, Ostend and Ghent
Distribution: Ubuntu
Posts: 600

Rep: Reputation: 30
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 .
Old 06-11-2004, 02:54 AM   #4
Senior Member
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
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.

Last edited by motub; 06-11-2004 at 02:57 AM.
Old 06-11-2004, 08:37 AM   #5
Registered: Feb 2004
Location: Atlanta, GA USA
Posts: 232

Rep: Reputation: 30
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
Old 06-11-2004, 08:06 PM   #6
Senior Member
Registered: Dec 2001
Location: 35.7480 N, 95.3690 W
Distribution: Debian, Gentoo, Red Hat, Solaris
Posts: 2,070

Rep: Reputation: 47
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.
Old 06-11-2004, 09:36 PM   #7
LQ Newbie
Registered: Apr 2004
Location: Australia
Distribution: SuSE 9.0 'Technology Evaluation'
Posts: 10

Rep: Reputation: 0
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.


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
Why "bash-2.05b$" in Terminal instead of "username@localhost username" jayelitumbiolo Linux - General 9 10-04-2009 04:16 AM
Oops! I did a chown -R root from the '/' level Wujen Linux - Newbie 4 04-06-2005 06:20 PM
useradd: invalid username username$ engyeow Fedora 5 12-05-2004 05:35 AM
chown -R ujotne Programming 3 02-25-2004 01:02 PM
chown? joetec Linux - Newbie 6 04-07-2002 05:46 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 06:40 AM.

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