LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Debian (https://www.linuxquestions.org/questions/debian-26/)
-   -   resetting permissions on everything? (https://www.linuxquestions.org/questions/debian-26/resetting-permissions-on-everything-327493/)

microsoft/linux 05-26-2005 08:13 PM

resetting permissions on everything?
 
Somehow, I messed up the permissions on a bunch of stuff on my system. I booted a couple of days ago, and was getting errors about ssh, and sudoers. So I changed those permissions, and then noticed, a bunch of other ones were wrong(include /etc/passwd and /etc/shadow). So I did a
Code:

cd /; chmod g-w . chmod o-w .
and that seemed to fix it. Then I rebooted, and the X server wouldn't start. I was able to start kdm, but kde wouldn't start. So I reversed the process

Code:

cd /; chmod g+w . chmod o+w .
and that seemed to fix it temporarily. Is there any way to reset the default permissions on everything? I'd rather not reinstall. Thoughts?

MS3FGX 05-27-2005 03:05 AM

As far as I know, setting the permissions on the entire file system is a game breaker.

The problem is, there is no "default" setting. Every file should have it's own permissions and ownership to maintain system security and stability.

So you can't just run a command to set everything back to the way it was before, since there is no way of knowing what that was.

I would have to say a reinstall is probably the most likely end to this story. Maybe somebody with more experience with this could give you a better direction to go down, but it seems like the amount of leg work it would take to track down all the different binaries and system files and give them the proper ownership and permissions would take a hell of a lot longer than just backing up your data and doing a fresh install.

microsoft/linux 05-27-2005 07:13 AM

there's no real data on it, it's mainly a toy machine right now. I don't have anything on it that's overly important. At this point I'm still uncomfortable with swtiching entirely from Windows to Linux. I don't want to reinstall. I just did that because my fs went beserk. Other people? Any Gurus have any experiance in this?

microsoft/linux 05-29-2005 03:44 PM

Is there any way to completely redownload and install all of the packages from my current system? I don't really want to wipe my partition out and reinstall.

microsoft/linux 05-30-2005 06:56 PM

will doing this
Code:

dpkg --get-selections | awk '$2 == "install" { print $1 }' | xargs apt-get -y --reinstall install
reset all the permissions?

J.W. 05-31-2005 03:01 PM

There is no way to undo or reset permissions to a previous value, because the previous value is not stored anywhere. As you have seen, setting permissions should not be taken lightly, and should only be done on individual files/directories when it is specifically needed.

Realistically the only safe and "guaranteed to work" option you have is to reinstall. To be honest there's no telling what the state of your system is right now, which unfortunately means that it cannot be considered secure, which means that the only sensible thing to do is wipe the disk and start over. You mentioned that this is a toy machine, so although doing a reinstall is somewhat of a hassle, it doesn't sound like you need to be concerned about losing any data. Good luck with it -- J.W.

MS3FGX 05-31-2005 07:18 PM

That's what I thought.

Not that I am terribly happy to be right in this situation, a reinstall can be a real joy kill.

But don't worry about it, it is part of the learning curve. I can't tell you how many times I had to reinstall the first year I started using GNU/Linux.

microsoft/linux 05-31-2005 08:58 PM

I don't know what happened to the permissions. I'll see if I can deal w/ it right now. Then, when sarge goes stable(hopefully w/in the next week) I'll get a CD set, and reinstall, then wait till next school year to update. Thanks


All times are GMT -5. The time now is 03:59 AM.