LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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-21-2010, 12:35 PM   #1
anas
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Rep: Reputation: 1
Unhappy help ! mass change_owner happend to my root file system in fedora


hi,
I have a fedora 14 system. I booted a suse installation that existed on an external harddisk and wanted to access my original fedora user home directory using non-root preveliges(so that i can use the gui file manager), so I searched on the internet and made a command to (chown -R mysuseUser:Users *) thinking that it will only affect the current mount permissions (not permenantly) put it did change the file system... i realized and cut it in the middle but some corruption was done. and then my fedora gui login screen was missing any username.
i tried to fix that by going to my fedora and executing chown (once using --from , and once without --from) and changed all root file system recursively to be owned by root and then changed my /home/myuserName ownerships all recursively to be owned by myUserName ....

after that... still the system is corrupted..... when i login to genome i have several crash messages (gdiskutility is one of them) and networking is disabled (i cannot connect to neither wireless nor wired nor wireless broadband). also when i plug USB/esata harddisks nothing happens

now i can only do work from my external harddisk`s suse linux.
what can i do to restore my system ? I have a previous dd image of my entire harddrive, but it is more than one month old and also I don`t want to do a restore to my entire harddrive.. can i clone some ownerships from files in dd image to their corresponding ones in my fedora system ? if so, how can i even mount a dd image ?
thanks in advance !
side note: my user name is derived from a non-english word, don`t be suspecious

Last edited by anas; 11-21-2010 at 12:40 PM. Reason: deleted confusing word repetitions
 
Old 11-21-2010, 05:11 PM   #2
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Hi, welcome to LQ!

As FC is an rpm based distro you may be able to recover from
your little accident via
Code:
for i in $(rpm -qa)
do
  rpm --setugids $i
done

Cheers,
Tink
 
1 members found this post helpful.
Old 11-21-2010, 05:17 PM   #3
pupok
LQ Newbie
 
Registered: Jul 2009
Location: Banská Bystrica, Slovak republic
Distribution: Slackware, Ubuntu
Posts: 18

Rep: Reputation: 2
Should be possible to fix

Quote:
Originally Posted by anas View Post

chown -R mysuseUser:Users *
...
and then my fedora gui login screen was missing any username
i tried to fix that by going to my fedora and executing chown (once using --from , and once without --from) and changed all root file system recursively to be owned by root
...
I'm afraid this is generaly bad idea. Not all system files should be owned by root. And changing ownership also clears SETUID and SETGID bits of files in question.

Quote:
Originally Posted by anas View Post

...
now i can only do work from my external harddisk`s suse linux.
what can i do to restore my system ? I have a previous dd image of my entire harddrive
...


As Tinkster said Fedora uses rpm based package manager, so I would try commands like this rpm --setugids <packagename>, rpm --setperms <packagename>. In this order.
More at http://www.cyberciti.biz/tips/reset-...ermission.html

As you are unable to login to your Fedora system, you have to boot to Suse and use proper options with rpm command. E.g. database path (dbpath) and root path (root).

As for dd'ed imade. It's AFAIK unusable without restoring first in this case.
 
Old 11-22-2010, 06:10 AM   #4
anas
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Original Poster
Rep: Reputation: 1
RE

hello,
thank you pupok and Tinkster,
>pupok :
Quote:
As you are unable to login to your Fedora system,
thanks but i can login through console as root, (i meaned that i cannot do my ordinary work on my system

> Tinkster: thank you, I tried it but it didn`t work , actually it transferred my gui login from crashy to unable_to_login

as I have a (some-how old) dd backup, I followed some tutorials on the net that uses losetup to mount the image using suse, then I used getfacl and setfacl --restore to restore the system file pemissions. however, it had no effect

some services are still failing to start (including HAL daemon and auditd) . my home/userName/.IECauthority is reported not accissible when i try to login even after i did a chmod a+rw to it.

when X starts it reports that (/var/gdm/.ICEauthority) is not accessible (it is not there, maybe one of my restoration trials deleted it in some way.. so i will try to restore it from my backup)

thank you all, I will keep trying until I am so desperate that I will restore my old backup ., will update you if god permits.
 
Old 11-22-2010, 09:51 AM   #5
anas
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Original Poster
Rep: Reputation: 1
Thumbs up solved (maybe in a way that weakens my system's security)

hi all

finally i solved the problem, I am now posting here from my fedora, but i think i solved it with a security disaster ! (i had to , i am on a hurry)
  1. I made a chmod -R a+rw * in the root file system
    edit:warning : after this step , i couldn`t login with root to console, but i was already logged in and doing the next step solved everything (together with this step)
  2. then i restored the access control list from an old backup(using getfacl & setfacl) into the root file system (at least to prevent some of the security disaster made during point 1) , (but before that , i manually changed some of the folder names in the access control list of the backup to reflect the new locations (i did this only to lib/modules/onlyOneOfKernelNumbers_notAllOfThem ), after i realized that there are many file/folder names to change ; i ignored the rest (there are many changed locations due to the fact that system updates change folder names to match package versions)
  3. after that i manually copied the var/lib/gdm/.ICEauthority permissions from the backup using setfacl from the old backup just to make sure (it was a main problem for gui login),it is now owned by gdm:gdm and have a+rwx permissions
  4. i restored the access control list of the /home directory from a more recent backup done only to the home

that's all, all problems disappeared, (but maybe many problems to come in future because of the a+rw thing on the /, although i hope not ... i am thinking of doing the rpm loop thing suggested by Tinkster again later.. or maybe gradually with system updates permissions will get to normal (anybody can confirm this ?))


Last edited by anas; 11-22-2010 at 10:58 AM. Reason: spelling & added a warning
 
Old 11-22-2010, 11:36 AM   #6
anas
LQ Newbie
 
Registered: Nov 2010
Posts: 4

Original Poster
Rep: Reputation: 1
hi , i tried again what tinkster said withone added command and i think now all my permissions are fixed./ i did the following :
Quote:
for i in $(rpm -qa)
do
rpm --setugids $i
rpm --setperms $i
done
I hope everything in my system is back to normal by now, (thanks Tinkster)
 
1 members found this post helpful.
Old 11-22-2010, 12:13 PM   #7
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
Quote:
Originally Posted by anas View Post
hi , i tried again what tinkster said withone added command and i think now all my permissions are fixed./ i did the following :


I hope everything in my system is back to normal by now, (thanks Tinkster)
Congratulations, nice work. :}


Cheers,
Tink
 
  


Reply



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
i cannot copy a file to a folder in file system with my root account realbezo Linux - Newbie 4 03-03-2009 10:45 PM
Linpus Fedora after saving files to file system, CAN'T open FILE SYSTEM from desktop! remiwa Fedora 2 01-07-2009 07:28 AM
System hangs on boot - "Mounting root file system" fails with Via VT6410 enabled Eagleorn Linux - Hardware 3 09-21-2006 12:58 PM
Boot Error: Root file system /dev/root adtomar Linux - Networking 0 12-27-2004 10:50 AM
USB mass storage device file system shariqali Linux - Hardware 1 02-19-2004 10:31 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:26 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration