怎样添加sudo|is not in the sudoers file

2025-05-23 08:01:15

1、执行命令:su -,输入超级管理员密码后切换到超级用户。不要漏掉“-”哦(-把root的环境变量传过去)。

怎样添加sudo|is not in the sudoers file

2、执行命令:visudo。是一个单词哦,不要打成vi sudo了!

怎样添加sudo|is not in the sudoers file

3、这是就会进入编辑界面,添加一行:user_name ALL=(ALL) ALL,然后保存并退出。(系统默认的编辑器可能讵畿缤耒会不一样哦,小编的是nano,退出时输入“ctrl+x”,如果是vi则是输入“a”进入编辑模式,添加完后按“esc”退出编辑模式,输入“:wq”保存并退出)。

怎样添加sudo|is not in the sudoers file

4、退出编辑后,执行命令:exit,退出超级用户。

怎样添加sudo|is not in the sudoers file

5、再次执行命令:sudo install xxxx,会发现不会出现“is not in the sudoers file”了。

怎样添加sudo|is not in the sudoers file
声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢