生成密钥==》执行命令==》输入密码==》配置完成
先要在ansible主机上执行ssh-keygen生产密钥
# 单命令暴力破解版(仅限测试环境)
ansible all -m authorized_key \
-a "user=root key='$(< ~/.ssh/id_rsa.pub)'" \
-k \
--ssh-common-args="-o StrictHostKeyChecking=no"
# 一行命令
ansible all -m authorized_key -a "user=root key='$(< ~/.ssh/id_rsa.pub)'" -k --ssh-common-args="-o StrictHostKeyChecking=no"
1636

被折叠的 条评论
为什么被折叠?



