gpt4 book ai didi

使用 RSA key 的 ssh 连接不断询问密码

转载 作者:行者123 更新时间:2023-12-04 22:05:48 24 4
gpt4 key购买 nike

我正在尝试使用 RSA key 在没有密码的情况下与许多服务器建立 SSH 连接。它对他们中的大多数人都有效,但其中一个给我带来了一些麻烦。

我过去发现的最常见问题是远程主机上 .ssh 或 authorized_keys 的权限问题,但在这里它们似乎是正确的,如下所示:

drwx------  ~/.ssh
-rw-r--r-- ~/.ssh/authorized_keys

这里是 ssh -v 命令到该服务器的输出(我只是更改了主机名和 IP):

Sun_SSH_1.1.3, SSH protocols 1.5/2.0, OpenSSL 0x0090704f
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: Rhosts Authentication disabled, originating port will not be trusted.
debug1: ssh_connect: needpriv 0
debug1: Connecting to myhost.mydomain.com [123.123.123.123] port 22.
debug1: Connection established.
debug1: identity file /export/home/webdev1/.ssh/identity type -1
debug1: identity file /export/home/webdev1/.ssh/id_rsa type 1
debug1: identity file /export/home/webdev1/.ssh/id_dsa type -1
debug1: Remote protocol version 1.5, remote software version 1.2.31
debug1: match: 1.2.31 pat 1.2.1*,1.2.2*,1.2.3*
debug1: Local version string SSH-1.5-Sun_SSH_1.1.3
debug1: Waiting for server public key.
debug1: Received server public key (768 bits) and host key (1024 bits).
debug1: Host 'myhost.mydomain.com' is known and matches the RSA1 host key.
debug1: Found key in /export/home/webdev1/.ssh/known_hosts:6
debug1: Encryption type: 3des
debug1: Sent encrypted session key.
debug1: cipher_init: set keylen (16 -> 32)
debug1: cipher_init: set keylen (16 -> 32)
debug1: Installing crc compensation attack detector.
debug1: Received encrypted confirmation.
debug1: Doing password authentication.

我怀疑这可能是由于 SSH 版本。另一个工作的服务器给了我以下输出(远程协议(protocol)版本 2.0 而不是 1.5):

debug1: Remote protocol version 2.0, remote software version Sun_SSH_1.1.3
debug1: match: Sun_SSH_1.1.3 pat Sun_SSH_1.1.*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-Sun_SSH_1.1.3

有什么线索吗?感谢您的帮助。

最佳答案

chmod 744 ~/.ssh/authorized_keys

为我工作。

关于使用 RSA key 的 ssh 连接不断询问密码,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3604861/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com