我使用 4096 字节的 RSA PGP 密钥;由于 SSH 也使用 RSA 标准,是否有可能将 PGP 密钥用作 SSH 密钥而无需在服务器上安装其他软件(并且尽可能少地在客户端上安装)?
我目前有一个 SSH 密钥,我已经使用了一段时间,我想开始使用带有新密钥环的 GnuPG。但是,鉴于我已经使用我的密钥多年,我仍然希望在 GPG 中使用该密钥作为主/主键。我已经尝试通过这些说明导入密钥。
但是,我最终得到了被认为是“子密钥”的东西。此外,如果我尝试在不创建标准 GPG 密钥的情况下导入它,GPG 甚至看不到这个子密钥。(我假设子密钥需要先由主密钥签名。)
如何使用此密钥作为 secring.gpg 中的主密钥?
即使我的 SSH 密钥看起来已被接受,我也收到了输入密码的提示。据我所知,下面日志中的“服务器接受密钥:pkalg ssh-rsa blen 277”行表示我的密钥已被接受。
以下是调试日志:
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/sam/.ssh/id_rsa
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 277
debug2: input_userauth_pk_ok: fp <<HASH REDACTED>>
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: /home/sam/.ssh/id_dsa
debug1: Trying private key: /home/sam/.ssh/id_ecdsa
debug2: we did not send a packet, disable method
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for …Run Code Online (Sandbox Code Playgroud) 我想设置一个证书颁发机构,然后我可以将其导入到公司的所有浏览器和系统中,以便在使用 HTTPS 或 SSL 时摆脱所有那些讨厌的客户端警告。
经常出现在公共 ssh-rsa 密钥末尾的 user@host 扮演什么角色?有必要吗?if 在身份验证中是否有任何用途,或者它只是记录谁以及在何处创建密钥以提供信息(对于人类读者)?
我认为我的问题归结为密钥有问题,但我不能只是解密它,以便进一步调查,而不对其进行解析。但我不确定。
我正在尝试使用标准方法:
openssl rsa -in ./id_rsa -out ./id_rsa.decrypted
Run Code Online (Sandbox Code Playgroud)
我想我知道密码,因为当我输入错误时,我得到:
Enter pass phrase for ./id_rsa:
unable to load Private Key
140256774473360:error:06065064:digital envelope routines:EVP_DecryptFinal_ex:bad decrypt:evp_enc.c:544:
140256774473360:error:0906A065:PEM routines:PEM_do_header:bad decrypt:pem_lib.c:483
Run Code Online (Sandbox Code Playgroud)
“坏解密”很清楚。现在,当我输入看似不错的密码时,我会回来:
Enter pass phrase for ./id_rsa:
unable to load Private Key
139662870623888:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:153:
139662870623888:error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header:tasn_dec.c:1314:
139662870623888:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:381:Type=RSA
139662870623888:error:04093004:rsa routines:OLD_RSA_PRIV_DECODE:RSA lib:rsa_ameth.c:115:
139662870623888:error:0D07207B:asn1 encoding routines:ASN1_get_object:header too long:asn1_lib.c:153:
139662870623888:error:0D068066:asn1 encoding routines:ASN1_CHECK_TLEN:bad object header:tasn_dec.c:1314:
139662870623888:error:0D07803A:asn1 encoding routines:ASN1_ITEM_EX_D2I:nested asn1 error:tasn_dec.c:381:Type=PKCS8_PRIV_KEY_INFO
139662870623888:error:0907B00D:PEM routines:PEM_READ_BIO_PRIVATEKEY:ASN1 lib:pem_pkey.c:132:
Run Code Online (Sandbox Code Playgroud)
它也无法加载密钥,但现在它在 asn1 解析器上失败了,与密码无关。
我可以以某种方式获得未加密版本的密钥并使用其他工具查看有什么问题吗?
我看过一些帖子,说有些东西发生了变化,看似好的密钥的可能原因无法解析,但它们都适用于未加密的版本。但他们唯一的方法是我看到的 …
据称,ed25519 密钥在安全性和性能方面优于 RSA。就安全性而言,我知道 4096 位 RSA 密钥在可预见的未来实际上是牢不可破的,所以我不会问这个。
我想了解的是性能差异(就速度而言)。当人们声称 ed25519 密钥更快时,这意味着什么?我是从用户的角度来问的。我考虑了几种可能性:
是哪一个?他们全部?他们都不是?
因此,我不是在问它们之间的数学差异,也不是在询问破解其加密的算法复杂性,也不是在问安全保证。我问的是现实世界用户应用程序中的速度。
sshd
$ /usr/sbin/sshd -f testconfig -p 22025 -d
debug1: sshd version OpenSSH_5.2p1
debug1: private host key: #0 type 0 RSA1
debug1: read PEM private key done: type RSA
debug1: private host key: #1 type 1 RSA
debug1: read PEM private key done: type DSA
debug1: private host key: #2 type 2 DSA
debug1: setgroups() failed: Operation not permitted
debug1: rexec_argv[0]='/usr/sbin/sshd'
debug1: rexec_argv[1]='-f'
debug1: rexec_argv[2]='testconfig'
debug1: rexec_argv[3]='-p'
debug1: rexec_argv[4]='22025'
debug1: rexec_argv[5]='-d'
debug1: Bind to port 22025 on 127.0.0.1.
Server listening on …Run Code Online (Sandbox Code Playgroud) 我在 Windows 上使用 Putty 和基于密钥的身份验证来访问我的一些服务器。
它使用 ~3700 位密钥完全正常,但使用 ~17000 位密钥,它会在客户端思考 20 秒,然后只是说“拒绝访问”并要求输入密码。
OpenSSH 中是否有用于基于密钥的身份验证的密钥长度限制或超时?
我知道使用这么大的键没有多少实际意义,尤其是在查看这 20 秒的计算时,只是试图解决我面临的任何问题:-)...
我的 ~/.ssh 文件夹中有这个 id_rsa。但它只是不进行身份验证。如果我复制它并将其重命名为 id_rsa 以外的任何名称,则它可以工作。
[qfan@mycomputer .ssh]$ ls -al id_rsa id_rsa_good
-rw------- 1 qfan qfan 1766 Dec 3 18:35 id_rsa
-rw------- 1 qfan qfan 1766 Nov 20 19:43 id_rsa_good
[qfan@mycomputer .ssh]$ sha1sum id_rsa id_rsa_good
8cc7f68170038b184bba0541be7d105bb36f7d11 id_rsa
8cc7f68170038b184bba0541be7d105bb36f7d11 id_rsa_good
[qfan@mycomputer .ssh]$ ssh localhost -i id_rsa
qfan@localhost's password:
[qfan@mycomputer .ssh]$ ssh localhost -i id_rsa_good
Enter passphrase for key 'id_rsa_good':
Last login: Tue Dec 3 18:46:46 2013 from 127.0.0.1
[qfan@mycomputer ~]$ exit
logout
Connection to localhost closed.
Run Code Online (Sandbox Code Playgroud)
请注意,“ssh localhost -i id_rsa”失败并且 ssh …
rsa ×10
ssh ×6
openssl ×3
ssh-keys ×3
gpg ×2
linux ×2
login ×1
passphrase ×1
performance ×1
pgp ×1
private-key ×1
public-key ×1
security ×1