PDA

View Full Version : How do I Undo a "chmod -R 777 on my /etc directory?



bob58
08-20-2004, 11:49 AM
Hello....I had done chmod -R 777 /etc and the problem is, I cannot begin to configure my desktop computer to network with my laptop cause when I do this:

dpkg-reconfigure ssh
/etc/init.d/ssh start
i get error saying my permissions on that folder are too open and it will not let me use ssh.

How can I change the permissions on my /etc folder back to default permissions? thank you :oops:

jjmac
08-20-2004, 12:47 PM
>>
Hello....I had done chmod -R 777 /etc and the
problem is, I cannot begin to configure my
desktop computer to network with my laptop cause
when I do this:

dpkg-reconfigure ssh
/etc/init.d/ssh start

i get error saying my permissions on that folder
are too open and it will not let me use ssh.

How can I change the permissions on my /etc folder
back to default permissions? thank you :oops:
>>

bob58...

hmmmmmmm....

The hard way, more than likely. You did a recursive
change mode. Setting everything "rwe". Not a
good idea.

You could try doing the recovery in a number of
steps, that is, firstly do...

]# chmod 754 -R /etc

Then go through each directory and make adjustments.
The directories can be set to "755",
non-recursive. Set the files to "544". Some
files will need to be set to "500", such as
lilo.conf, and other related security things.

I like to kill all world access to directories/files myself.

You may need to do a...

]$ dpkg -S path_to_file

to find the various packages that files belong
to. Then actually look into the packages to
find their default permissions. But you will need
actual packages to work with there.

Or, find another box some where that you can
template it off, which may be a better idea.
That means pen and paper of course.


You must have done that as "root".


That's a good example of why we do not use our
"root" account unless absolutly neccessary, buddy !!!!!

If you have the Knoppix LiveCD handy, you
could boot that up, mount your somewhat "open"
system, and then use the default permissions from
the ramdisk knoppix image to template a
re-permissioning of your dedicated /etc directory.
That may be the easiest way to do it.

LiveCD's can be handy things, no ?

A dual pane file manager will help there too (filerunner)

Good Luck.

jm