I am having difficulty importing SSH key files int...
# general
v
I am having difficulty importing SSH key files into NetSuite. I get the completely unhelpful "Unexpected Error". I used ssh-keygen to create a keyfile and public key with a passphrase; this created a text file with a begin and end tag for type OPENSSH PRIVATE KEY. Trying to import the file produces "Unexpected error" at the top of the import window immediately on Save. Some things I've tried to overcome this: • Changed the passphrase to not have special characters <>), • Removed the passphrase completely • Tried re-base64 encoding the whole file, over the top of the existing base64 encoding already present (based on a lead I read somewhere) • Changing the tag to RSA PRIVATE KEY • Using an RSA format instead (new key generation) • Converting embedded newline chars to \r\n All of these produce the same error. The documentation around this feature is remarkably sparse and doesn't cover file requirements other than the file is in "PEM format" (which I think the output of ssh-keygen is). I find that in NetSuite, usually "Unexpected Error" comes from expected numbers containing text, or other data errors. But without more context, I can't fix this problem. Is anyone able and willing to share some insight?
m
No idea about this personally, but other programs I've used before have refused to work with ssh-keygen files, and will only work with the putty ones (they are a bit of a different format). You might try seeing if a putty key would work (although it is a lot more of a pain and isn't password protected).
Best of luck with this
e
Is this how you’re generating the key?
Copy code
ssh-keygen -t rsa -m PEM
v
I didn't use the -m PEM option directly, but the output file does have the -----BEGIN OPENSSH PRIVATE KEY----- and similar END tags. I was going to try to include that explicitly to see if that changed anything.
e
I just tried to generate a new one with the command above. Uploaded the private key file generated and it worked.
v
I will try that momentarily.
Yes, apparently the -m PEM option is required.
Thanks for your help, our key is setup now.