1. 重新设置目录及文件的 uids 和 gids

for u in $(rpm -qa); do rpm --setugids $u; done

 

2. 设置文件目录所需要的权限

for p in $(rpm -qa); do rpm --setperms $p; done

 

3. 设置ssh相关文件的权限

chmod 600 /etc/ssh/ssh_host_rsa_key
#chmod 600 /etc/ssh/ssh_host_dsa_key
service sshd restart

 

前辈的帮助
http://www.adminlinux.org/2009/07/how-to-restore-default-system.html
https://unix.stackexchange.com/questions/12998/wrongly-set-chmod-777-problems
https://unix.stackexchange.com/questions/1323/i-accidentally-chmod-r-x-on-a-directory-how-do-i-restore-the-correct-permissi


搬瓦工优质海外服务器购买链接:http://t.cn/Rdru0Ah

使用优惠码 BWH26FXH3HIQ  最高减6%