20.7.3.2. Generating a DSA Key Pair for Version 2


Use the following steps to generate a DSA key pair for version 2 of the SSH Protocol.
  1. To generate a DSA key pair to work with version 2 of the protocol, type the following command at a shell prompt:
    ssh-keygen -t dsa
    Accept the default file location of ~/.ssh/id_dsa. Enter a passphrase different from your account password and confirm it by entering it again.

    Note

    A passphrase is a string of words and characters used to authenticate a user. Passphrases differ from passwords in that you can use spaces or tabs in the passphrase. Passphrases are generally longer than passwords because they are usually phrases instead of a single word.
    The public key is written to ~/.ssh/id_dsa.pub. The private key is written to ~/.ssh/id_dsa. It is important never to give anyone the private key.
  2. Change the permissions of the .ssh directory with the following command:
    chmod 755 ~/.ssh
  3. Copy the contents of ~/.ssh/id_dsa.pub into the file ~/.ssh/authorized_keys on the machine to which you want to connect. If the file ~/.ssh/authorized_keys exist, append the contents of the file ~/.ssh/id_dsa.pub to the file ~/.ssh/authorized_keys on the other machine.
  4. Change the permissions of the authorized_keys file using the following command:
    chmod 644 ~/.ssh/authorized_keys
  5. If you are running GNOME or a graphical desktop environment with the GTK2+ libraries installed, skip to Section 20.7.3.4, “Configuring ssh-agent with a GUI”. If you are not running the X Window System, skip to Section 20.7.3.5, “Configuring ssh-agent.
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.