gpt4 book ai didi

ssh - 如何在Ansible命令中传递用户名/密码

转载 作者:行者123 更新时间:2023-12-03 12:07:45 28 4
gpt4 key购买 nike

我想将Ansible用作另一个Python软件的一部分。在该软件中,我有一个包含其用户名/密码的主机列表。

有没有一种方法可以将SSH连接的用户/密码传递给Ansible ad-hoc命令或以加密方式将其写入任何文件中?

还是我完全理解错误,并且唯一的方法就是使用SSH认证?

最佳答案

When speaking with remote machines, Ansible by default assumes you are using SSH keys. SSH keys are encouraged but password authentication can also be used where needed by supplying the option --ask-pass. If using sudo features and when sudo requires a password, also supply --ask-become-pass (previously --ask-sudo-pass which has been deprecated).



从未使用过该功能,但 docs表示可以。

关于ssh - 如何在Ansible命令中传递用户名/密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37004686/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com