gabrieldemarmiesse / python-on-whales

An awesome Python wrapper for an awesome Docker CLI!
MIT License
537 stars 100 forks source link

SSH fingerpring #605

Open YuriOsokin opened 2 months ago

YuriOsokin commented 2 months ago

In the scripts, during connection to a new machine, openSSH requests to accept the fingerprint. It pops up a new window. However, this is not comfortable. I did not find any option to accept the fingerprint autometically, such as AutoAddPolicy policy in paramiko. Not typing 'yes' in the popup leads to "Host key verification failed".

I see that popup happens during subprocess run, but I did not find any solution to disable the check only for the current run. All the solutions are to disable the check completely.

image

gabrieldemarmiesse commented 1 month ago

Python-on-whales uses the normal docker client underneath. Meaning that it's the same issue you would have if you were to call docker in a bash script. The docker client uses the SSH client of the system (linux or windows or mac). So the normal fingerprinting issues apply.

In general, when you want to automate adding fingerprints when scripting with ssh, you can use ssh-keyscan. That's the solution I would recommend.