1.1把你的用户添加到sudo白名单
1.1.1登录root账户
1.1.2进入 /etc目录
输入 cd /etc
1.1.3更改文件 sudoers权限(原文件只读)
输入 chmod u+w sudoers 添加写权限
1.1.4用vim进入sudoers
输入vim sudoers进入
1.1.5往下翻找到这个
root ALL=(ALL)ALL
1.1.6直接在键盘上按i进入输入模式,在root ALL=(ALL)ALL下面输入
你的用户名 ALL=(ALL)ALL
把你的用户添加到sudo白名单
1.1.7键盘上按esc退出键,退出输入模式。然后输入:wq 回车 保存退出
1.1.8把文件权限改回去
输入chmod u-w sudoers