3.2.2. Generating Keys Manually
The following instructions describe how to generate a new pair of RSA or DSA keys.
- Run the following command to generate a pair of keys, replacing KeyType with the type of key to generate:
ssh-keygen -t KeyType
- 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
NoteRed Hat recommends to save all SSH keys in the default location. If an
id_rsafile already exists, rename the new SSH key file to avoid overwriting the existing one.
- 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. ...