—問題:
常見問題:普通用戶使用yum安裝軟件提示:You need to be root to perform this command 還有以下截圖問題
1:使用yum安裝軟件centos7可以,兩個centos6.5失敗
2:centos7上sshd服務無法重啓,但在centos6.5上可以
3: centos7上可以創建用戶並添加密碼,但是centos6.5不可以
4:事實證明,ssh是通的呀,執行command沒問題!
===========================================================================================
二:解決辦法:
1:vim /etc/ansible/ansible.cfg,開啓如下選項
[privilege_escalation] ##這一部分爲提升權限的參數,如果使用普通用戶需要開啓。
become=True
become_method=sudo
become_user=root
become_ask_pass=False
2:sudo visudo
tomcat ALL=(ALL) NOPASSWD:ALL ##無密碼登陸