-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Weird "sshkeys" SSH public key validation error #144
Comments
Not sure if it's relevant, but the same error was showing up in a fork of Proxmox at one point: pimox/pimox7#45 |
Interestingly, the above mentioned error in the other fork seems relevant here too. If I comment out that same
Although the ssh key is accepted, and shows up in the cloud-init section for the VM, it's not actually happy. The key itself doesn't appear to have been loaded into the user in question. Checked by looking through the VM disk with a rescue system, and the So, maybe something in the Go code really is mucking up that string somehow. |
Hmmm, the server might actually be wanting the actual text of the ssh key, rather than a path. However, I'm not having much luck in figuring out what PVE calls "url encoding" as it doesn't seem to be any of the common URL encoding calls in Go. 😦 Example:
Result:
Also tried It feels like PVE may have it's own ideas about url encoding, and there might need to be a special purpose encoder created just for this one interaction with it. 😉 |
Ahhh yep, got it somewhat figured out. That Someone on the Proxmox forums had a similar issue (not via Go though) a Proxmox staff member gave a Python solution for doing the quoting: https://forum.proxmox.com/threads/how-to-use-pvesh-set-vms-sshkeys.52570/#post-243381
That's a Python 2 version of things. As Python 3 is where things are at these days, it's now:
Using that Python 3 snippet I was able to manually url encode an ssh key such that Proxmox accepts it:
Copying that string into the Go vmProps and just passing it directly works, with the VM being created and the ssh key name showing up in the webUI the same way it does for
|
yup and the docs say you can do multilple keys in one config just separate with a newline. glad you figured it out! |
Any idea if there's a Go function call for doing the "url encoding" that Proxmox wants? |
try this: https://pkg.go.dev/net/url#QueryEscape |
Heh, that's literally one of my above examples of something that doesn't work. 😉 Tried it again now, just in case... and nope, it's definitely not a winner:
That's from calling it this way in my Go code:
|
it appears to be failing this regex, check your output from your funcs to escape and find the right combintation |
Thanks. Saw that and might investigate that later on. 😄 |
Facing this same issue - if Proxmox is going to even come close to VMWare on an enterprise level, or even SMB, this kind of stuff can't exist. How has no one fixed this blatant UI issue - I have tried multiple forms of SSH keys generated from PuttyGen (including removing the Comment line as documentation says it isn't supported) and I cannot get this to work. I'm not going to go editing my Proxmox - this should work out of the box - or at a minimum there should be a clear guide on how it should work (i.e. if the PuttyGen style SSH key doesn't work, then what does.) |
Ahhh. Sorry for not investigating this further. After finding the lack of disk import functionality (#145) I've given up on using the Proxmox API until basic required functionality (aka "being able to create a new VM") is present. |
I'm trying to create a VM with a cloud-init ssh key, but the server keeps on returning
500 SSH public key validation error
. 😕It seems pretty weird, as the exact same key works fine when using
qm
on the server itself to create the VM.The code in question for creating the VM:
If I remove that last vmProps line (the
sshkeys
one), then the vm creation works. With that in place though, I'm getting:The working
qm
version of it:Anyone have ideas what could be going wrong?
The text was updated successfully, but these errors were encountered: