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組