Setting up SSH Keys

Note : this tutorial assumes that you are running a linux-based operating system. While it may be possible to set up ssh keys on a Windows or OS X machine, we have yet to explore and document these capabilities.


Let's say that you're logging into the Computer Science machines using the command “ssh”. You're using your own computer (that only you have access to) and you've become tired of typing in your password every time. By following the directions below, you can set up ssh keys. This will allow you to log into mote without a password, enable you to automate scripts that use the ssh protocol, and by changing from using a password to using ssh keys, increase your account's security.

How to Set up Your Keys

  • Step 1: Open up a terminal. On many systems, you can do this by hitting Control-Alt-t.
  • Step 2: Type in “ssh-keygen -t rsa”. Hit enter.
  • Step 3: You will now be prompted for a file in which to save the key. Without typing anything, hit enter.
  • Step 4: You will be prompted to enter a passphrase. Again, without typing anything hit enter, and then when asked to enter the same passphrase again, hit enter again.
  • Step 5: Your screen should now look like the screenshot below. Now it's time to copy a key over to mote. Enter the command “ssh-copy-id”, where “myUsername” has been replaced with the username associated with your cs account. Hit enter.

  • Step 6: You should see a message that says “Number of key(s) added: 1 …”. If you see this message, everything should have worked correctly!
  • Step 7: Verify that everything worked correctly. Type in “ssh”, where again, “myUsername” has been replaced with your CS username. You should log in automatically, without needing to enter a password!