根目錄執行chmod -R 777 / 的補救方法


ch /etc/

chmod 644 passwd group shadow

chmod 400 gshadow

cd ssh

chmod 600 moduli ssh_host_dsa_key ssh_host_key ssh_host_rsa_key

chmod 644 ssh_config ssh_host_dsa_key.pub ssh_host_key.pub ssh_host_rsa_key.pub

chmod 640 ssh_config

然后嘗試使用ssh登錄,正常。

如果使用普通用戶登錄,使用su - 切換root會出現以下錯誤:

root "su cannot set groups"

這是因為su必須有s權限才能預讀取root的相關配置,需要使用如下命令:

chmod u+x  `which su`

然后就可以進入系統了。

找一台干凈的機器,把系統的權限導出,然后在導入本機

在干凈的機器上執行:getfacl -R / > ./linux.chmod.bak

在本機上執行:setfacl --restore=/root/linux.chmod.bak

重啟服務器使權限生效

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM