linux 将用户添加到sudoers用户组

修改/etc/sudoers文件权限
进入超级用户,因为没有写权限,所以要先把写权限加上

chmod u+w /etc/sudoers  

编辑/etc/sudoers文件

vim /etc/sudoers

找到这一 行:"root ALL=(ALL) ALL"在起下面添加"airflow ALL=(ALL) ALL"(airflow是用户名),然后保存。

## Allow root to run any commands anywhere   
root    ALL=(ALL)       ALL  
airflow ALL=(ALL) ALL  

注:如果不想每次都输入密码,可以修改后不需要每次都输入密码了。

xxx ALL=(ALL)  NOPASSWD: ALL  

最后恢复没有写权限模式
撤销文件的写权限

chmod u-w /etc/sudoers