# accidental chown -R root:root /

## xadin

I wasnt sure where to put this but since chown had to do with security i figured this would be a good spot.

been having problems updating a year old server install. Ive been adding mythtv capabilities to it and have been having alot of problems with it. ive yet to post about it cause im having fun figureing it out , but

one of the things i tried to do was chown -R /mnt/share (for myth recordings) and I accidently did 

chown -R mythtv:users / 

so that screwed up all my perms, i immediately changed them all to root:root to avoide any security problems.

after realizing i cant su in cause of authentication problems, i came to the realization of how hard itll be to change it all back to origional. 

does anyone know of a site that will tell origional permissions.

a way to change them back. 

or maybe would like to at least list the most important ones. 

Id really like to avoide a reinstallation of gentoo on this 1000 mhz comp and as of right now its the only one going (usually have 3) so i dont have a reference for all the perms.

thanks in advance

----------

## PMcCauley

The original permissions you need to restore depends on the software you use you may need to set apache to own it's files as well if you use an MTA or other programs like that.  You can find out the hard way after one of these programs don't run.  If you don't have those types of services just chown stuff back to users in /home.

Patrick

----------

## tane_stelzer

I have read a previous post about this and the solution to it was unfortunatly redo the system. It was supposed to be faster than finding out the original perms. WEll i might be wrong and a page id dedicated to perms of the system but I surly dont know it.

tane

----------

## xadin

*update* so after resetting all my directories to chown root:root I reset my home to its chown.

problems im seeing,

- before reboot i noticed and stated above that i cant su in i get an authentication error. 

- I  decided to 

/etc/init.d/modules restart 

and the comp locked my screen in x with artefacts.

so i hard rebooted. when i last working on the system i just finished recompiling a new kernel, and updating grub, but never got to copy the kernel over, so it hitched at grub of course but i got past that with no problems. 

to my surprise i got no unusuall errors on bootup of services, even apache works fine. probably cause it sets its user and group on its own. the only prob so far is i get alot of errors for gnome and needed services for gnome wont start so gnome is rendered completely useless. So has anyone got any tips on gnome perms ? i definatly dont think i should reinstall, i like to do all this stuff the hard way. you learn more

 :Smile: 

----------

## tane_stelzer

I think this is quite risky its a server and wrong permission are not good.

Tane

----------

## xadin

 *tane_stelzer wrote:*   

> I think this is quite risky its a server and wrong permission are not good.
> 
> Tane

 

I know the risks, this isnt an important server.

----------

## xadin

Ok, ive decided on the backup and reinstall. at least ill know everythings the way i want it then. Maybe ill put up a site sometimes with a list of perms, usergroups, etc.. that each program needs.

----------

## Dark_Ebola

i've a similar problem.

i've infact installed a new hdd after an arroused party (birthday) and did a cp -R (from live CD) from an hdd to the new one ...

i'll let you imagine the state of the perms on my system.

i've emerged back xorg, it fixed some permissions and i'm now able to run X fine  :Smile: 

i still need to recover sound, and su ability.

i'm currently emerging -e world, but it seems it won't fix most of my perms problems.

----------

## ykram

 *xadin wrote:*   

> *update* so after resetting all my directories to chown root:root I reset my home to its chown.
> 
> problems im seeing,
> 
> - before reboot i noticed and stated above that i cant su in i get an authentication error. 
> ...

 

the su problem is probably due to /bin/su not having the suid bit.

----------

## plq

I know it may be a bit too late to repy to this, but, I've done the same thing.

(chown root:root -R * .* ; chmod go-rwx -R * .* (wd: /root) which eventually ascended to .. and processed part of my file tree, before I realized that this was taking too long) 

I adjusted most of the permissions manually, comparing them to other gentoo machines that I admin.

anyway, after everything looked fine, still no other user than root worked. If you have the same problem, I think you should check the permissions of / as well. For me, everything started working after I did it.

```

warehouse / # ls -la

total 52

drwxr-xr-x  20 root     root   4096 Sep 18 11:44 ./

drwxr-xr-x  20 root     root   4096 Sep 18 11:44 ../

(...)

```

the permissions must be chmod 755 and chown root:root.

hope it helps

----------

