[Solved] Forbid root, handle error sudo must be owned by uid 0

1. Using a non root login is an error in sudo

sudo: /usr/bin/sudo must be owned by uid 0 and have the setuid bit set
Processing: After re-logging in
chown root:root /usr/bin/sudo
chmod 4755 /usr/bin/sudo

2. Disable root remote login

*** Not disable root login, not root account
#sudo vim/etc/ssh/sshd_config
Find PermitRootLogin yes and change it to no
*** If the reverse is true, restore root remote, find
Find and comment out this line: PermitRootLogin prohibit-password
PermitRootLogin no to yes

** After the change, sudo /etc/init.d/sshd restart, or just reboot and reboot

3. Other accounts join sudo

First switch to root
Execute su and enter the password
vi /etc/sudoers and add XXX (username) to the following
# User privilege specification
	 root   ALL=(ALL:ALL) ALL
	dhbm    ALL=(ALL:ALL) ALL

Similar Posts: