when we use the ansible tool, the default is to use ssh for remote control.
you need to generate key pairs in a way similar to ssh-keygen-t rsa
, and then use the ssh-copy-id command to distribute the public key file to a remote host
and enter the password of the remote host once, so that you can use ansible to remotely control the host
so how do you do this with python? The main purpose of
is to accomplish this task:
batch distribute public keys, record failed hosts, delete key information on remote hosts, etc.?