Generating a Publickey

Tutorial: Getting Started

Introduction

Linux has a great utility called secure shell (ssh) that allows you to login to a remote machine. Of course, this usually only gives you a terminal and no GUI. In order to login to a remote machine with ssh you first have to have an account on the remote machine. There are two ways to authenticate, either with a password typed in at login or with a keyfile. Passwords are generally insecure for any machine that accepts ssh connections from anywhere on the internet. So instead most servers use publickey authentication. You first generate a privatekey and publickey on your local machine, which are rather long strings of random characters. Then you send your publickey to the remote machine and add it to ~/.ssh/authorized_keys on the remote machine. You can then ssh into the remote machine without a normal password. Your privatekey (the one not ending in “pub”) is now your password, so don’t share it. It is also common practice to give your privatekey a password that must be entered in order to "unlock" it. This is just an extra layer of security so that if anyone ever does get your privatekey file, they cannot use it without the password.

Linux (and Mac OS)

The whole process is very easy on linux, as all of the necessary utilities should already be installed by default. Although I've only tested these instructions on Ubuntu, I expect they'll work on most distros as well as Mac OS.

  1. Open a terminal (commonly Ctrl+Alt+T)
  2. Type ssh-keygen and press enter
  3. Press enter to save the files in the default dir of ~/.ssh
  4. Enter a password for the privatekey, or press enter (twice) to have no password
  5. There are now a bunch of files in ~/.ssh
  6. NOTE: any directory starting with a period is hidden by default

Windows

The process is a bit more involved on Windows for a number of reasons. Basically Microsoft doesn't want to play nice with other Operating Systems, even if they have been around longer and developed industry-accepted standards. For more Microsoft rants, and why you should give Linux a try, visit Why Linux.

  1. Download PuTTYgen
  2. Save it somewhere permanent (it's an executable, not an installer)
  3. Double-click PuTTYgen to open it
  4. Click the "Generate" button
  5. Move your mouse around in the blank area to create randomness
  6. Click "Save public key" and save it as id_rsa.pub
  7. Click "Save private key" and save it as id_rsa.ppk

NOTE: It doesn't matter if Windows marks your id_rsa.pub as a Publisher file. It just does that based on the file extension which doesn't actually matter. The file is still an SSH key file containing your public key. In fact, it's plaintext, so you could view it with Notepad if you wanted.

Conclusion

You now have your own public/private key pair. Never give anyone your private key! That is your password so keep it secret. You need to get your public key onto grandline so that you can connect. Visit Connecting to Grandline to find out how.