centos、ubuntu將用戶添加到sudo

1、sudo yum install 安裝軟件經常需要切換root用戶或者sudo。

沒有設置sudo報錯:

xx is not in the sudoers file. This incident will be reported.

 

2、centos設置sudo

su - # 切換root

visudo # 編輯sudoers文件

找到:## Allow root to run any commands anywhere

pzhang ALL=(ALL) ALL # 添加一行,保存退出

3、ubuntu 設置sudo

sudo adduser pzhang sudo  # 添加到sudo組

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章