Mac OSX/Linux: Generating SSH keys

On Mac/Linux

  1. Creating A Key

    To create the most simple key, with the default encryption, open up a console, and enter the following command :

    $ ssh-keygen -t rsa

    It will output the following (the "key fingerprint" will be different):

    Generating public/private rsa1 key pair.
    Enter file in which to save the key (/home/(youruserdir)/.ssh/id_rsa):
    Enter passphrase :
    Enter same passphrase again:
    Your identification has been saved in /home/(youruserdir)/.ssh/id_rsa.
    Your public key has been saved in /home/(youruserdir)/.ssh/id_rsa.pub.
    The key fingerprint is:
    22:bc:0b:fe:f5:06:1d:c0:05:ea:59:09:e3:07:8a:8c

    At the "Enter file in which to save the key" prompt, just hit enter to store the keys in the default location indicated.
    At the "passphrase" prompts, enter a secure password you can remember. Enter the same password both times.

  2. In the .ssh directory, located in your home directory, there will be two files that were generated: your public key and your private key, collectively referred to as your 'key-pair'. They will be named id_rsa and id_rsa.pub unless you changed the location to save them when prompted. The one with the .pub extension is your public key. The public key can be transmitted over insecure channels, such as email and instant messenger, and can even be posted in public places like a website safely. Your private key should never be transmitted over a network, or allowed to be downloaded and distributed in any way. If someone gets your private key and cracks your password, they will have access to every system your public key is installed on.
  3. Once located, send an email to support@advomatic.com. The most reliable way to transfer an SSH key is to send it as an file attachment in your email program. To easily copy it to your home directory, issue the following command in a terminal: cp ~/.ssh/id_rsa.pub ~/
  4. We will install the public key on the server you require access to. We will give you a username and the server's hostname. When prompted for a password, use the one you provided when you generated your keys. Essentially, you have locked your private key with a password, and have to unlock it in order to use it to login.
Contact Us
Drupal Association The Drupal Association is an organization dedicated to helping the open-source Drupal CMS project flourish. We help the Drupal community with funding, infrastructure, events, promotion and distribution. See how Advomatic is contributing back to the Drupal community.