useradd 添加用户后,用sudo无法提权,虽然密码正确,也会提示密码错误

解决方法
在root用户下
chmod 777 /etc/sudoers
echo 'username ALL=(ALL) ALL' >> /etc/sudoers
chmod 440 /etc/sudoers
现在在切换到普通用户就可以使用sudo 提权了
useradd 添加用户后,用sudo无法提权,虽然密码正确,也会提示密码错误

解决方法
在root用户下
chmod 777 /etc/sudoers
echo 'username ALL=(ALL) ALL' >> /etc/sudoers
chmod 440 /etc/sudoers
现在在切换到普通用户就可以使用sudo 提权了
5356
3538
2万+

被折叠的 条评论
为什么被折叠?