sudo权限的问题
使用sudo的时候会报:
1 | xxx 不在 sudoers 文件中。此事将被报告。 |
那很明显,我需要把我的用户加入sudoers文件中。
解决方法
切换到root用户。
进入/etc目录。
使用vim /etc/sudoers编辑文件。
关于vim的使用方法,可以看一下这篇:vim的使用方法。
在
1 | # Allow members of group sudo to execute any command |
这一串下边加上自己的用户,编辑结果:
1 | # Allow members of group sudo to execute any command |
如果想要在使用sudo命令的时候不输入密码,在编辑sudoers文件的时候添加NOPASSWD: 即可,像这样:
1 | # Allow members of group sudo to execute any command |