message "An SSH key uniquely identifies you (and your computer) when your computer is communicating with other computers. Think of an SSH key as a fancy password."
message "You'll need one of these to create your Heroku and Github accounts."
option "Did you use RailsInstaller on Windows?" do
message "Congratulations, you already have an ssh key!"
option "Do you have a preexisting SSH key for some other reason?" do
message "Maybe you went to a previous RailsBridge workshop, or generated an SSH key to push some code to GitHub? You can check with the following command:"
console "ls ~/.ssh/id_rsa"
message "If you see the message **No such file or directory**, you don't have an SSH key yet."
option_half "'No such file or directory'" do
message "Go on to <a href='#generate-key'>Generate an SSH key"
option_half "'/Users/[something]/.ssh/id_rsa'" do
a name: "generate-key"
option "Generate an SSH key" do
important "Use the same email address for heroku, git, github, and ssh."
important "**REPLACE** `firstname.lastname@example.org` with your **actual email address** below."
console "ssh-keygen -C email@example.com -t rsa"
message "Press enter to accept the default key save location."
message "Next, you'll be asked for a keyphrase."
h1 "Choose whether to use a keyphrase"
option_half "No keyphrase" do
message "Hit enter to accept blank passphrase, then hit enter again."
option_half "Keyphrase" do
message "If your computer is shared with other people, as in a work laptop, you should choose and enter a real passphrase. Twice."
message "After key generation is complete, you'll have output that looks like this."
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/student/.ssh/id_rsa):
Created directory '/Users/student/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /Users/student/.ssh/id_rsa.
Your public key has been saved in /Users/student/.ssh/id_rsa.pub.
The key fingerprint is:
message "Your brand-new public key is now stored at `~/.ssh/id_rsa.pub`"
message "`~` is the home directory for the current user. That's you!"
tip "Public vs. Private Keys" do
message "If you look inside `~/.ssh/`, you will notice two files with the same name: `id_rsa` and `id_rsa.pub`."
message "`id_rsa.pub` is your **public key** and can be shared freely."
message "`id_rsa` is your **private key** and must be kept secret."
message "If someone else gets your private key and your passphrase, then they can pretend to be you and log on to your Heroku or Github accounts and cause mischief!"
message "Add your generated public key to the authentication agent using the following command:"
console "ssh-add ~/.ssh/id_rsa"
Enter passphrase for /Users/student/.ssh/id_rsa:
Identity added: /Users/student/.ssh/id_rsa (/Users/student/.ssh/id_rsa)"
If you find something that could be improved, please make a pull request or drop us a note via GitHub Issues (no technical knowledge required).