id_rsa与id_rsa.pub

本文介绍了如何使用ssh-keygen工具生成和管理SSH协议所需的RSA和DSA密钥。此外还详细说明了各种密钥文件的作用及其存放位置。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

man ssh-keygen
====
     ssh-keygen generates, manages and converts authentication keys for ssh(1).  ssh-keygen can create RSA keys for use by SSH
     protocol version 1 and RSA or DSA keys for use by SSH protocol version 2.  The type of key to be generated is specified with
     the -t option.


FILES
     $HOME/.ssh/identity
             Contains the protocol version 1 RSA authentication identity of the user.  This file should not be readable by anyone
             but the user.  It is possible to specify a passphrase when generating the key; that passphrase will be used to
             encrypt the private part of this file using 3DES.  This file is not automatically accessed by ssh-keygen but it is
             offered as the default file for the private key.  ssh(1) will read this file when a login attempt is made.

     $HOME/.ssh/identity.pub
             Contains the protocol version 1 RSA public key for authentication.  The contents of this file should be added to
             $HOME/.ssh/authorized_keys on all machines where the user wishes to log in using RSA authentication.  There is no
             need to keep the contents of this file secret.

     $HOME/.ssh/id_dsa
             Contains the protocol version 2 DSA authentication identity of the user.  This file should not be readable by anyone
             but the user.  It is possible to specify a passphrase when generating the key; that passphrase will be used to
             encrypt the private part of this file using 3DES.  This file is not automatically accessed by ssh-keygen but it is
             offered as the default file for the private key.  ssh(1) will read this file when a login attempt is made.

     $HOME/.ssh/id_dsa.pub
             Contains the protocol version 2 DSA public key for authentication.  The contents of this file should be added to
             $HOME/.ssh/authorized_keys on all machines where the user wishes to log in using public key authentication.  There
             is no need to keep the contents of this file secret.

     $HOME/.ssh/id_rsa
             Contains the protocol version 2 RSA authentication identity of the user.  This file should not be readable by anyone
             but the user.  It is possible to specify a passphrase when generating the key; that passphrase will be used to
             encrypt the private part of this file using 3DES.  This file is not automatically accessed by ssh-keygen but it is
             offered as the default file for the private key.  ssh(1) will read this file when a login attempt is made.

     $HOME/.ssh/id_rsa.pub
             Contains the protocol version 2 RSA public key for authentication.  The contents of this file should be added to
             $HOME/.ssh/authorized_keys on all machines where the user wishes to log in using public key authentication.  There
             is no need to keep the contents of this file secret.

     /etc/moduli
             Contains Diffie-Hellman groups used for DH-GEX.  The file format is described in moduli(5).

转载于:https://my.oschina.net/weiweiblog/blog/1548311

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值