加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > 安全 > 正文

ssh – 如何更改私钥密码?

发布时间:2020-12-15 18:44:16 所属栏目:安全 来源:网络整理
导读:我有一个现有的公钥/私钥对.私钥受密码保护,加密可以是RSA或DSA.这些键是使用ssh-keygen生成的类型,通常存储在?/ .ssh下. 我想更改私钥的密码.我如何在标准的Unix shell上进行操作? 另外,我该如何删除密码?只需将其更改为空? 要更改默认DSA密钥上的密码,
我有一个现有的公钥/私钥对.私钥受密码保护,加密可以是RSA或DSA.这些键是使用ssh-keygen生成的类型,通常存储在?/ .ssh下.

我想更改私钥的密码.我如何在标准的Unix shell上进行操作?

另外,我该如何删除密码?只需将其更改为空?

要更改默认DSA密钥上的密码,请执行以下操作:
$ssh-keygen -p -f ~/.ssh/id_dsa

然后在提示时提供您的新旧密码(两次). (如果你有RSA密钥,请使用?/ .ssh / id_rsa.)

man ssh-keygen的更多细节:

[...]
SYNOPSIS
    ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment]
               [-f output_keyfile]
    ssh-keygen -p [-P old_passphrase] [-N new_passphrase] [-f keyfile]
[...]
     -f filename
             Specifies the filename of the key file.
[...]
     -N new_passphrase
             Provides the new passphrase.

     -P passphrase
             Provides the (old) passphrase.

     -p      Requests changing the passphrase of a private key file instead of
             creating a new private key.  The program will prompt for the file
             containing the private key,for the old passphrase,and twice for
             the new passphrase.
[...]

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读