[Solved] Retrieve all the permission of the /bin folder

hello friends,

By mistake I have run find / -type f -exec chmod 644 {} \;

now all permission has been chaged of /bin
I am not able to change the permission. I am working on the virtuozzo VPS.

Is their any way to retrieve the permission to 770 to /bin
Note /bin/chmod also not executing

Please help me.

"chmod" is probably not executing because it has already been hit by "chmod 644" and has now its executable status revoked.

You can try to use "install", which can copy a file to some destination and set its file mode in the process. It might have not beeen hit by your command AND it might not make use of the "chmod" executable (i am not sure about this, but it is worth a try).

If this doesn't work your best bet is to mount the filesystem in question on another (equivalent) system and use "install" or "chmod" from there to recreate the filemodes. You could write a script which cycles through all the files mounted under "/", reads the filemode of every file and applies this on the respective file at "/where/your/fs_is_mounted".

It might be faster to just restore the last backup in this case.

I hope this helps.

bakunin

1 Like

Thank you for graceful reply,

The issue has been resolved . I have changed the file permissions from the main node where the files of the containers were mounted. Now the VPS is running fine

:slight_smile: