josenk / terraform-provider-esxi

Terraform-provider-esxi plugin
GNU General Public License v3.0
538 stars 154 forks source link

SSH key auth for connect to esxi #218

Closed UrusovVladimir closed 5 months ago

UrusovVladimir commented 5 months ago

How do i connect to esxi with ssh key? I don't want to use password because it's not safe enough. Thanks!

josenk commented 5 months ago

The plugin uses ssh and ovftool. Ovftool doesn't support ssh keys, so this plugin doesn't support ssh keys.

iamjackg commented 4 months ago

I can't find any information aobut ovftool requiring SSH access: everything I can find points to it accessing the ESXi API via HTTPS. Do you have any pointers?

iamjackg commented 4 months ago

Looked into it some more. There is no mention of SSH in the ovftool manual. The only section talking about non-HTTP/HTTPS/FTP protocols has this to say:

image

This seems to confirm that ovftool does not use SSH at all? The SSH package in the Go stdlib supports key authentication: https://pkg.go.dev/golang.org/x/crypto/ssh#PublicKeys