Automatically establish keyless login with expect

It is best to use ssh-copy-id to establish a keyless login,
but it has a problem that it adds data to the authorized_keys file mindlessly every time, which is easy to cause duplication, and if there are many servers to be established, it needs to be run multiple times. Enter "yes" multiple times and enter the password multiple times.
Use expect to automatically install
https://github.com/kabike/autoSSHKey

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326586505&siteId=291194637