—问题:
常见问题:普通用户使用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 ##无密码登陆
转载于:https://blog.51cto.com/358778493/1873079