View previous topic :: View next topic |
Author |
Message |
smorrey n00b
Joined: 08 May 2005 Posts: 30
|
Posted: Sat Sep 10, 2005 11:21 am Post subject: Doh! Permissions for / |
|
|
Well, yep I somehow managed to chmod 777 /
Thus giving the entire world permission to read+write+exec anything if so inclined.
Just curious to know what that they are supposed to be at?
Thanx! |
|
Back to top |
|
|
Dlareh Advocate
Joined: 06 Aug 2005 Posts: 2102
|
Posted: Sat Sep 10, 2005 11:30 am Post subject: |
|
|
755 _________________ "Mr Thomas Edison has been up on the two previous nights discovering 'a bug' in his phonograph." --Pall Mall Gazette (1889)
Are we THERE yet? |
|
Back to top |
|
|
jettjunker Apprentice
Joined: 10 Sep 2005 Posts: 267
|
Posted: Sat Sep 10, 2005 10:21 pm Post subject: |
|
|
My problem is very similar, so I figured I would just post here rather than make a new thread.
I accidently:
Code: | sudo chmod 777 /*/* |
Now when I startx all I get is a bunch of errors and a blank desktop with only computer and trash links. I can write down the specific errors if I need to, but I imagine there is either an easy fix or none at all.
Is there a way to reset permissions?
It is my first week in linux, so detailed instructions would be greatly appretiated.
One thing to be aware of: before I shut it down, I tried to sudo something, but I got the error: "sudo: /etc/sudoers is mode 0777, should be 0440". I couln't even change it back to 0440 because that requires using sudo to begin with. |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sat Sep 10, 2005 10:38 pm Post subject: |
|
|
You bastard! I had my answer ready for your other thread and you had to delete your post before I could submit! |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Sat Sep 10, 2005 10:43 pm Post subject: |
|
|
Ewwww.
Do you have a backup, or another Gentoo machine with similar packages installed, which you could mount somewhere (with a mountpoint deeper than /*/*)? Then you could probably fix it using something like this:
Code: |
for f in /*/*;
do
chmod -v --reference="/path/to/deep/mount/point/$f" "$f";
done;
|
This sets the permission using the original files as reference, which should cause permissions to go back to normal. Note that this works only for files which are present in your mountpoint.
If someone tells me how to print the mode of a file in a way chmod can handle, any Gentoo user could provide you with a list of required permissions. Then you could fix it even if you didn't have a backup / other Gentoo machine.
In any case, I recommend you trash your /dev (setting DEVICE_TARBALL to no, deleting the tarball, rebooting should be okay if you use udev). |
|
Back to top |
|
|
jettjunker Apprentice
Joined: 10 Sep 2005 Posts: 267
|
Posted: Sun Sep 11, 2005 8:06 pm Post subject: |
|
|
Doh, sorry about that. I was just trying to minimize clutter as the forum rules advise.
I ended up having a friend come over that is good with linux. He was nervous about using that script, becuase he thought it might cause more problems and the only way to test it is to run it...
So, he booted up a live cd, mounted my drive, and "chmod 755 /*/*". Then "chmod 440 /etc/sudoers" (to allow sudo). To get gnome back up without all those startup errors I mentioned before he had to "chmod 700 /tmp/*<username>" and "chmod 700 /tmp/*root"
That should get anyone as stupid as me back up and running, but there were quite a few more files changed. I pulled up a ssh of his /, and manually repaired any further discrepancies. |
|
Back to top |
|
|
frostschutz Advocate
Joined: 22 Feb 2005 Posts: 2977 Location: Germany
|
Posted: Mon Sep 12, 2005 6:22 am Post subject: |
|
|
jettjunker wrote: | I ended up having a friend come over that is good with linux. He was nervous about using that script, becuase he thought it might cause more problems and the only way to test it is to run it... |
Even if it didn't work, it'd been easy to undo - just run chmod 777 /*/* again. |
|
Back to top |
|
|
|