What are the requirements for AWS OpsWorks SSH keys?

Ah ... silly me.

AWS OpsWorks is asking for the key that will be deployed to the app server, so it needs the private key (including -----BEGIN RSA PRIVATE KEY----- and -----END RSA PRIVATE KEY----- delimiters).

The github deploy key, obviously, is the public key.


AWS Opsworks needs the private key instead of the public. If the field returns:

Please provide a valid SSH key

You probably copy pasted the public key. After you've generated a SSH key (for more information about this see: https://help.github.com/articles/generating-ssh-keys/ )

You want to copy the private key by entering the following command in your terminal.

pbcopy < ~/.ssh/id_rsa

And then paste the private key in the Repository SSH field. Please note that you need to assign the public key to the repository.

http://docs.aws.amazon.com/opsworks/latest/userguide/workingapps-deploykeys.html


I solved this problem by following these steps:

  1. ssh-keygen -t rsa -C "[email protected]" -m PEM
  2. When you get to this step Enter passphrase (empty for no passphrase): just press return to skip passphrase setup. Otherwise, AWS won't able to clone your app repo