H
H
Hint2011-03-10 22:16:20
linux
Hint, 2011-03-10 22:16:20

Terrible bug with chmod?

I wanted to recursively set permissions for the folder to 644 and entered the chmod -R 644 / command.
I caught myself late, but interrupted the execution of the command.
Advise on how to minimize damage. And is it possible to restore the system. Or do you have to build from scratch now?

Answer the question

In order to leave comments, you need to log in

15 answer(s)
W
wholeman, 2011-03-10
@wholeman

Did you manage to restore execution rights to the directories themselves?

V
v1z, 2011-03-10
@v1z

Yes, it happens and this =(
Reminded:

S
Sergey, 2011-03-10
@bondbig

Wow, a notable shot in his own leg.
I would boot from livecd, copy the configs/data and reinstall the OS. All other options will not give 100% certainty, but what the heck you need a server with a bunch of skeletons in the closet.

V
Valistar, 2011-05-04
@Valistar

It is necessary to change the habit of writing chmod ./will work the same way if you writechmod .

A
admin4eg, 2011-03-11
@admin4eg

I once gave 777 to the whole system ... then nothing else worked either :)
we boot into the "single mode" and we can execute any commands to restore rights

R
r00tkit, 2011-03-10
@r00tkit

Mmm... Sometimes rm -rf / helps, but I'm not sure what will save in this case, everything has been running for a long time and deeply...

W
wholeman, 2011-03-10
@wholeman

Copy normal chmod through scp -p /bin/chmod [email protected]:then /home/user/chmod +x /bin/*fail? (Instead of "user", of course, you need to put the correct name.)

A
asm0dey, 2011-03-10
@asm0dey

cp doesn't work either?
sudo?

@
@dendery, 2011-03-10
_

if it was gentoo I would restore the build environment and rebuild the world.
accordingly, you can try to do something similar in a binary distribution by generating a list of packages installed in the system and download these packages again with the force flag or something like that, while not forgetting to say that do not touch the configs.
these are general considerations.
the particular decision will depend on the particular distribution of the package manager and common sense.
common sense is that if you don’t want to clean up
underground knocks for another n-th time, and they will, you need to rearrange the system from scratch.

V
Vlad Zhivotnev, 2011-03-10
@inkvizitor68sl

Get a LiveCD that can work with FS, and restore what you need.

K
kekekeks, 2011-03-10
@kekekeks

You don’t have launch rights on libs there, and as a result, it issues a permission denied.

A
asm0dey, 2011-03-10
@asm0dey

In general, you still need to set permissions for all directories 755, for all files 644 /

K
kekekeks, 2011-03-11
@kekekeks

Install now in parallel with sshd dropbear (there you will only need to correct the port in its config). In theory, a session should start through it.

R
r0ster, 2011-05-04
@r0ster

Once I encountered the same situation, I don’t know why, but it immediately came to mind to open another server in Kitty (Putty) and WinSCP (fortunately, other servers with the same system (Debian) were at hand and compare the contents of the directories on the two servers, and expose rights/owner similarly to a "healthy" system.
Try it, it might help you too. As an option, put the same OS on the virtual machine as on the server and compare with it.
Let it take a long time, but a working way. And he rescued me.

P
pewpew, 2013-02-08
@pewpew

This is something else ... I once chmod -R 777 / performed. I wanted to apply recursively to the current folder, but it turned out for the entire system. As a result, of course, everything works (except for some reason VSFTPD), but the system is definitely under demolition.
Nothing, such Zen strengthens the nerves. This is useful.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question