Linux下is not in the sudoers file解決方法

當咱們使用sudo命令切換用戶的時候可能會遇到提示如下錯誤:xxx is not in the sudoers file. This incident will be reported,xxx是你當前的用戶名,究其緣由是用戶沒有加入到sudo的配置文件裏html

Linux下is not in the sudoers file解決方法
  1. 切換到root用戶,運行visudo命令ide

    Linux下is not in the sudoers file解決方法
  2. 在打開的配置文件中,找到root ALL=(ALL) ALL,在下面添加一行htm

    xxx ALL=(ALL) ALL 其中xxx是你要加入的用戶名稱blog

    Linux下is not in the sudoers file解決方法
  3. 3

    輸入:wq保存並退出配置文件,再次使用sudo命令就不會有上面的提示了。ci

     

    注意事項

    • 編輯配置文件的時候最好使用visudo命令,不然可能會出現其餘錯誤get

相關文章
相關標籤/搜索