搜索

此内容没有您所选择的语言版本。

20.3.4.2. Generating a DSA Key Pair for Version 2

download PDF
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, skip to Section 20.3.4.4, “Configuring ssh-agent with GNOME”. If you are not running the X Window System, skip to Section 20.3.4.5, “Configuring ssh-agent.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.