3.2.2. Generating Keys Manually

The following instructions describe how to generate a new pair of RSA or DSA keys.
  1. Run the following command to generate a pair of keys, replacing KeyType with the type of key to generate:
    $ ssh-keygen -t KeyType
  2. Press Enter when prompted to save the key file in the default location:
    ...
    Generating public/private rsa key pair.
    Enter file in which to save the key (/home/username/.ssh/id_rsa): /home/username/.ssh/id_rsa

    Note

    Red Hat recommends to save all SSH keys in the default location. If an id_rsa file already exists, rename the new SSH key file to avoid overwriting the existing one.
  3. Enter a passphrase or leave blank when prompted, then press Enter:
    Enter passphrase (empty for no passphrase):
    Enter same passphrase again:
    Your identification has been saved in /home/username/.ssh/id_rsa
    Your public key has been saved in /home/username/.ssh/id_rsa.pub.
    ...