1、使用非 root 登錄是,sudo出現錯誤
sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
處理:重新 root 登錄後
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo
2、禁止 root 遠程登錄
*** 不是禁止 root 登錄,不能禁止 root 賬號
#sudo vim /etc/ssh/sshd_config
找到 PermitRootLogin yes 改爲 no
*** 如果反過來,恢復 root 遠程,找到
找到並註釋掉這行:PermitRootLogin prohibit-password
PermitRootLogin no 改爲 yes
** 修改之後,sudo /etc/init.d/sshd restart ,或者直接 reboot 重啓
3、其他賬號加入 sudo
首先切換到 root
執行 su ,輸入密碼
vi /etc/sudoers,在以下地方加上 XXX (用戶名)
# User privilege specification
root ALL=(ALL:ALL) ALL
dhbm ALL=(ALL:ALL) ALL