配置来自 ePass2003 的 SSH 密钥以访问服务器。
我在 VirtualBox 上有一个来宾 ubuntu 16.04,我能够从 VM SSH 服务器 1,但是当从服务器 1 SSH 到服务器 2 时,出现以下错误。
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 60
debug1: Server accepts key: pkalg rsa-sha2-512 blen 279
debug2: input_userauth_pk_ok: fp SHA256:M0HzYuvGQ8LcKpJIGPgQDrN6Xs8jpyjH4wRQdslGeV
debug3: sign_and_send_pubkey: RSA SHA256:M0HzYuvGQ8LcKpJIGPgQDrN6Xs8jpyjH4wRQdslGeV
**sign_and_send_pubkey: signing failed: agent refused operation**
Run Code Online (Sandbox Code Playgroud)
当我在服务器 2 上运行ssh-add -l时,我可以看到以下输出。
$ ssh-add -l
error fetching identities for protocol 1: agent refused operation
2048 SHA256:M0HzYuvGQ8LcKpJIGPgQDrN6Xs8jpyjH4wRQdslGeV /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so (RSA)
Run Code Online (Sandbox Code Playgroud)
我在/etc/ssh/sshd_config文件中设置了AllowAgentForwarding yes。但是仍然没有运气从 Server1 获得到 Server2 的 SSH 连接。如果有人可以帮助我度过难关,那就太好了。
提前致谢 !!
我能够修复 SSH 密钥的连接问题。我必须在位置/etc/ssh/ssh_config和~/.ssh/config 的SSH 配置文件中进行更改
$ cat ~/.ssh/config
Host *
Compression yes
ForwardAgent yes
ForwardX11Trusted no
GSSAPIAuthentication no
PreferredAuthentications=publickey
Run Code Online (Sandbox Code Playgroud)
和
$ cat /etc/ssh/ssh_config
Host *
ForwardAgent yes
ForwardX11Trusted yes
HashKnownHosts yes
GSSAPIAuthentication no
GSSAPIDelegateCredentials no
Run Code Online (Sandbox Code Playgroud)
上述更改后,重新启动ssh-agent并执行ssh-add。
$ eval $(ssh-agent)
$ ssh-add -s /usr/lib/x86_64-linux-gnu/opensc-pkcs11.so
Run Code Online (Sandbox Code Playgroud)
如果您遇到此类问题,我希望这也适用于你们所有人。
我想补充一点,我看到了同样的问题(在 Ubuntu 18.04 中),它是由我的私钥文件的错误权限引起的。我chmod 600在相关文件上做了,问题解决了。不知道为什么 ssh-agent 直到今天才抱怨这个。
| 归档时间: |
|
| 查看次数: |
11409 次 |
| 最近记录: |