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