zun*_*arz 2 ssh sftp key-authentication
sftp.foobar.com的管理员已执行以下操作:
这是我的.ssh/config 条目
Host foobar
identityfile id_rsa
hostname sftp.foobar.com
user foo_user1
port 22 # I've also tried 2222
$sftp -vvv foobar
OpenSSH_7.4p1, OpenSSL 1.0.2k-fips 26 Jan 2017
debug1: Reading configuration data /home/foo_client/.ssh/config
debug1: /home/foo_client/.ssh/config line 332: Applying options for foobar
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 58: Applying options for *
debug2: resolving "sftp.foobar.com" port 2222
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to sftp.foobar.com [21.01.148.55] port 2222.
#The session hangs and I CTRL-C to terminate command.
$ssh 21.01.148.55
# I get no response
# I get neither userid nor password prompt.
Run Code Online (Sandbox Code Playgroud)
问题:关于主机服务器上的公钥,我可以得出什么结论?
我是否有足够的信息来断定 foobar 管理员尚未安装我的公钥?
如果他们已安装公钥但已损坏,我是否可以从 -vvv 输出中获取更多信息?
您无法确定有关公钥的任何信息。您的连接被防火墙阻止。
\nSSH 的调试输出不会帮助您诊断防火墙问题:它们发生在 TCP 以下的级别。这可能是您的计算机、本地网络、(不太可能)介于两者之间、服务器的本地网络或服务器本身的问题。tcptraceroute
可能有帮助。
以下是一些示例输出,其中包含您在成功连接时会看到的一些相关消息:
\n\xe2\x80\xa6\ndebug1: Connecting to sftp.foobar.com [21.01.148.55] port 2222.\ndebug1: Connection established.\ndebug1: identity file /home/foo_client/.ssh/id_rsa type -1\n\xe2\x80\xa6\ndebug1: Remote protocol version 2.0, remote software version OpenSSH_8.9p1 Ubuntu-3ubuntu0.4\n\xe2\x80\xa6\ndebug1: Will attempt key: /home/from_client/.ssh/id_rsa \n\xe2\x80\xa6\ndebug1: Next authentication method: publickey\n\xe2\x80\xa6\ndebug1: Offering public key: \xe2\x80\xa6\n\xe2\x80\xa6\nAuthenticated to sftp.foobar.com (21.01.148.55:2222) using "publickey".\n\xe2\x80\xa6\n
Run Code Online (Sandbox Code Playgroud)\n(我稍微编辑了这些消息,可能得到了主机名的确切格式等错误。)
\n值得注意的是:
\ndebug1: Connecting
是客户端启动 TCP 连接的时间。debug1: Connection established.
表示TCP连接已建立。您的连接未能到达此点。debug1: Remote protocol version \xe2\x80\xa6
是服务器已使用 SSH 协议进行回复的第一个指示。debug1: Will attempt key:
表示您的客户端找到的密钥。debug1: Next authentication method: publickey
表示在与服务器协商后,您的客户端决定尝试公钥身份验证。debug1: Offering public key: \xe2\x80\xa6
表示您的客户端现在正在尝试使用此密钥进行身份验证。Authenticated to sftp.foobar.com (21.01.148.55:2222) using "publickey".
表示服务器已接受最后提供的密钥。 归档时间: |
|
查看次数: |
441 次 |
最近记录: |