I had a big mistake
I run this command on a centos 6.8 server:
chmod 0644 -R /* instead of chmod 0644 -R ./*
now directory listing on root directory / and all files failed
when I run this command:
chmod 0775 -R /*
I get this error:
bash: /bin/chmod: Permission denied
how can I fix it without reinstall my centos?
Answer
Reinstalling the OS is by far the easiest and quickest way to fix this. Take an image backup first so you can recover anything that hadn't made it to your regular backup before the disaster happened.
The alternative is to boot from CentOS installation media or some other Linux live media, mount your CentOS system partitions on /mnt
, and and then manually fix the permissions on every file and directory. Note that setting 775 globally is not enough to make your system usable again. There are files and directories that must have different permissions settings in order to work. This is long and tedious work, and you'll wish you had heeded the advice to reinstall.
No comments:
Post a Comment