【发布时间】:2013-05-18 17:29:52
【问题描述】:
我一直在 cygwin 上尝试“ssh localhost”(我使用 WINdows 7),但它一直在询问密码。
当我执行“ssh -vvv localhost”时,我发现公钥身份验证没有发生(或失败)。因此,它要求输入密码。
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug3: start over, passed a different list publickey,password,keyboard-interactive
debug3: preferred publickey,keyboard-interactive,password
debug3: authmethod_lookup publickey
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/xxxxxxxx/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,password,keyboard-interactive
我不确定它是否无法读取 authorized_keys 文件,或者是否存在超时问题,或者身份验证是否失败?有什么方法可以获取更多详细信息?
我做了以下步骤:
- ssh 主机配置。对所有人的回答都是肯定的。
- 生成 RSA 密钥并将其添加到 authorized_keys 文件中。
- net start sshd
- ssh 本地主机
这些是权限:
-rw------- 1 xxxxxxxx mkgroup 402 May 18 16:34 authorized_keys
-rw------- 1 xxxxxxxx mkgroup 1675 May 18 16:33 id_rsa
-rw-r--r-- 1 xxxxxxxx mkgroup 402 May 18 16:33 id_rsa.pub
-rw-r--r-- 1 xxxxxxxx mkgroup 171 May 18 14:33 known_hosts
还有几个问题: - 组显示为 mkgroup。 - 本地主机中不存在用户“xxxxxxxx”,我猜。 它没有显示在“net user sshd”中。 “xxxxxxxx”是域帐户。 这会导致公钥身份验证问题吗?
只是为了看看输出有什么不同,我把authorized_keys文件删了试了下。输出没有区别。它仍然发送一个数据包并继续进行下一个身份验证模式。没有错误信息。有没有其他方法可以获取更多详细信息(我是 Cygwin 和 SSH n00b)?我想在读取authorized_keys文件时发现它失败了。
【问题讨论】:
-
你有某种 NAT 吗?有时它可能会破坏连接。
标签: ssh cygwin localhost public-key