As I was following thought the tutorial on the same topic, https://www.digitalocean.com/community/tutorials/how-to-use-terraform-with-digitalocean I successful was able to create a nginx server but then an error happened, beginning from the md5 of ssh public key <Failed to parse ssh private key: ssh: cannot decode encrypted private keys> The tutorial is recent and I’m running this on MacOS. Any help will be appreciated
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
yes I have the same TF file that is used within the tutorial. However, the ssh keys that is encrypted poorly is not being sync. An error is thrown because of this and that DO cannot decrypt the poor encryption. Error: Failed to parse ssh private key: ssh: cannot decode encrypted private keys it’s the same as the one I added to my account
Upon further researching, I cam across this troubleshooting https://stackoverflow.com/questions/54982050/parseprivatekeywithpassphrase-returns-ssh-cannot-decode-encrypted-private-keys
Below states that DO doesn’t support openSSh encrypted keys
If you look at the docs here : https://www.terraform.io/docs/provisioners/connection.html. I don’t see a field to set the pass for the key. So I would try again with an unencrypted key and it should work. Alternatively, you could simply use the user_data field instead of remote-exec. I’m no cloud init expert, but I believe it wouldn’t require a ssh connection then. Also like I said, I would really add the key to DO so that you don’t need so many variables and can just reference the key from your digitalocean_ssh_key resource.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.