For those who are trying out Heroku for the first time, and have not set up their Mac for keypair authentication, here is what you need to do in order to generate ssh public keys.

If you keep seeing this:

$ heroku create
Enter your Heroku credentials.
Email:
Password:
No ssh public key found in /Users/mike/.ssh/id_[rd]sa.pub.  You may want to specify the full path to the keyfile.

1. Generate RSA key:

$ ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/mike/.ssh/id_rsa):
Enter passphrase (empty for no passphrase):
Your identification has been saved in /Users/mike/.ssh/id_rsa.
Your public key has been saved in /Users/mike/.ssh/id_rsa.pub.
The key fingerprint is:
The key's randomart image is:

2. Generate DSA key:

$ ssh-keygen -t dsa
Generating public/private dsa key pair.
Enter file in which to save the key (/Users/mike/.ssh/id_dsa):
Enter passphrase (empty for no passphrase):
Your identification has been saved in /Users/mike/.ssh/id_dsa.
Your public key has been saved in /Users/mike/.ssh/id_dsa.pub.
The key fingerprint is:
The key's randomart image is:

3. Create your Heroku app:

$ heroku create
Enter your Heroku credentials.
Email:
Password:
Uploading ssh public key /Users/mike/.ssh/id_rsa.pub
Created http://myapp.heroku.com/ | git@heroku.com:myapp.git
Git remote heroku added

Viola! This applies for any situation requiring ssh keys – sftp access, capistrano deployment, etc.

Leave a Comment

Mike's Favorite Tweets