centos7 默认普通用户没有sudo权限,因此需要我们手动设置步骤:
1、su进入root用户,vi /etc/sudoers
2、找到文件中的下列文字:
###
Allow root to run any commands anywhere
root ALL=(ALL) ALL
在该行下面添加如下即可
xxx ALL=(ALL) ALL
xxx代表用户名
3、然后保存退出,再次切换到普通用户下,执行sudo命令就可以看到相应的信息了。
该文章作备忘功能。
时间:2022-09-16 16:46:05
centos7 默认普通用户没有sudo权限,因此需要我们手动设置步骤:
1、su进入root用户,vi /etc/sudoers
2、找到文件中的下列文字:
###
Allow root to run any commands anywhere
root ALL=(ALL) ALL
在该行下面添加如下即可
xxx ALL=(ALL) ALL
xxx代表用户名
3、然后保存退出,再次切换到普通用户下,执行sudo命令就可以看到相应的信息了。
该文章作备忘功能。