yaml Plugin: Format of Inline Data
michaelheider opened this issue · 5 comments
The yaml plugin allows us to use inline data instead of files.
What format should the values in authorized_keys_data
and private_key_data
have? Could you please give some more specific information than "base64 inline data"? I cannot get sshpiper to accept the values. It just seems to ignore what I pass it. Using the file based parameters works fine. Could you maybe give a concrete example?
simple base64 -w0 yourfile
did you get any error?
I hope you don't mind me interjecting here, but I've been struggling with a similar issue, which is setting the known_hosts_data field in the yaml routing file.
Honestly I don't even know what the contents of that property should look like. Could you point me in the right direction? I've tried copying some stuff from the ~/.ssh/known_hosts but that would not work. I don't know which parrt.
When I use ssh-keyscan remotehost I get three keys and don't know which to use, or if I need to preceed the data with the hostname and keytype.
example
ssh-keyscan -p 2222 host-publickey | base64 -w0
# yaml-language-server: $schema=https://raw.githubusercontent.com/tg123/sshpiper/master/plugin/yaml/schema.json
version: "1.0"
pipes:
- from:
- username: "publickey_simple"
authorized_keys_data: "c3NoLXJzYSBBQUFBQjNOemFDMXljMkVBQUFBREFRQUJBQUFCZ1FETjVVMlVQaUR2VXRJNVkwRUo0b0xESU96ZExMbkluYjdPeFNuYjY1SGpEU1VIdjJsVFRMOFUrNzgwelkraWZPNHBHWFZLM3M5RWMzMlhESmVaRGcvbTFlRGx3SG4wTU1INTVSWlhqRTg5WHp2MGh1SFh6SzQ2R25KaDQxZTZpNkhJbzBOMU9sNFRaQ0dsT09YU2FYeURRYWtRTDlWRjN4aDJJWUV1VW1vUlg2NWYxMTN2SVVldVVUVVlqdXVlVmFmc2daNGJCd2VLM1VVcENaK0duUkJLUllqOWJDM1BYbkFWeUwzd0F1d01wQjA5TDZmNHNYNWR4aCtPZS9QZDNaRFFkQUV0a0laZE5BZ0szQldFU1piMWhsc3JyVDZqb2M2bTdXMVVCT1FYRzV2TXUyTVpkWnNpVWdtN3hnL3dZT1J5SWpXZFUySDBPL2QxYnR1SU5GWWNQVzVZQ2MzNXprUzQvVk4vcW9IbkQ2S25WNmhrMTlqblh6MEtPUktST0o4Tm1TVmM3dXBjMD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BRTJWalpITmhMWE5vWVRJdGJtbHpkSEF5TlRZQUFBQUlibWx6ZEhBeU5UWUFBQUJCQkI1UXFxRk9lc2o2bWlSM2dOZG91YUREZXBtRkMvVy9jQ3RNd0pkT1JvR1NHR29vWDdWREN0Vzh5d0xsRmNXcDFoYW0wdjFWOExwQ0kvWkZQMGxwS2lVPQpbaG9zdC1wdWJsaWNrZXldOjIyMjIgc3NoLWVkMjU1MTkgQUFBQUMzTnphQzFsWkRJMU5URTVBQUFBSUhLZTVqTWUrTVI4dEJjN0dOMmQrN1R4RWlPclAvTFJkYVBlNlZMakpveVIK"
you can also take a look at https://github.com/tg123/sshpiper/blob/master/e2e/yaml_test.go to check how e2e test create config
let me know if your config not work
Oh that worked perfectly. Thank you so much!
Had I checked out yaml_test.go, I indeed would have probably figured it out. I'm not new to software development, but still new to the Go language, so I had some trouble figuring things out from the yaml plugin itself. Thankfully, I stumbled onto this issue here.
Thank you very much.
Awesome piece of software by the way!