Failed to connect to the host via ssh: Permission denied

Failed to connect to the host via ssh: Permission denied ,第1张

Ansible执行playbook出现如下问题

原因:
ansible是使用ssh协议去执行的命令,所以看当前用户的ssh是否正常,当前是root用户,在sshd配置文件中开启了PermitRootLogin no ,所以执行失败,修改为PermitRootLogin yes即可

sed -i 's/PermitRootLogin no/PermitRootLogin yes/g' /etc/ssh/sshd_config && systemctl  restart sshd

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/742263.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-04-28
下一篇2022-04-28

发表评论

登录后才能评论

评论列表(0条)

    保存