kch*_*kch 364 unix ssh passphrase ssh-keygen
我有一个现有的公钥/私钥对。私钥受密码保护,加密可以是 RSA 或 DSA。这些密钥是您生成ssh-keygen并通常存储在~/.ssh.
我想更改私钥的密码。在标准的 Unix shell 上,我该怎么做?
另外,我如何简单地删除密码?直接改成空?
Mik*_*zur 478
要更改默认密钥的密码:
$ ssh-keygen -p
Run Code Online (Sandbox Code Playgroud)
如果需要指定键,请传递-f选项:
$ ssh-keygen -p -f ~/.ssh/id_dsa
Run Code Online (Sandbox Code Playgroud)
然后根据提示提供您的旧密码和新密码(两次)。(~/.ssh/id_rsa如果您有 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.
[...]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
273155 次 |
| 最近记录: |