【问题标题】:SSH permission errorSSH权限错误
【发布时间】:2015-04-28 03:02:12
【问题描述】:

我看过很多关于 ssh 权限被拒绝的帖子,但我仍然一无所知。

debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Authentications that can continue: publickey,keyboard-interactive
debug1: Trying private key: /home/siddharthan/.ssh/id_rsa
debug3: no such identity: /home/siddharthan/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /home/siddharthan/.ssh/id_dsa
debug3: no such identity: /home/siddharthan/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/siddharthan/.ssh/id_ecdsa
debug3: no such identity: /home/siddharthan/.ssh/id_ecdsa: No such file or directory
debug2: we did not send a packet, disable method
debug3: authmethod_lookup keyboard-interactive
debug3: remaining preferred: password
debug3: authmethod_is_enabled keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug1: Authentications that can continue: publickey,keyboard-interactive
debug3: userauth_kbdint: disable: no info_req_seen
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey,keyboard-interactive).

从上面我可以说它正在.ssh 文件夹中搜索私钥。但是在下面的sn-p中,很明显各个文件都在.ssh文件夹下。

total 12
-rw-r--r-- 1 siddharthan siddharthan 751 Apr 27 17:40 keyforHpc
-rw-r--r-- 1 siddharthan siddharthan 606 Apr 27 17:40 keyforHpc.pub
-rw-r--r-- 1 siddharthan siddharthan 222 Apr 27 19:29 known_hosts

我已经使用了大约一个月,今天我才开始遇到这个问题。谁能给点建议?

【问题讨论】:

  • 即使文件夹中存在 pvt 密钥,您也必须验证另一端的公钥。缺少任何一个都可能导致问题。
  • 您文件上的时间戳表明它今天已重命名,而 ssh 不知道要查找名为 keyforHpc 的文件。
  • 也许您收到No such file or directory 是因为尝试访问密钥的应用程序无权访问它们?密钥权限非常严格(-rw-r--r--),什么用户试图访问它们?
  • 您是否检查过主驱动器上的剩余空间。我曾经在全驱动时遇到过这个问题。

标签: linux ssh


【解决方案1】:
debug1: Trying private key: /home/siddharthan/.ssh/id_rsa
debug1: Trying private key: /home/siddharthan/.ssh/id_dsa
debug1: Trying private key: /home/siddharthan/.ssh/id_ecdsa

-rw-r--r-- 1 siddharthan siddharthan 751 Apr 27 17:40 keyforHpc

这些文件名不匹配。它正在寻找id_rsaid_dsaid_ecdsa,而你有keyforHpc

【讨论】:

  • 感谢大家的建议。问题出在另一端。最近我的大学集群正在进行一些维护,因此我的密钥在集群中被删除了。现在它在恢复那些 .ssh 文件后工作正常。关于 id_rsa 和 id_dsa 的搜索,据我所知,它只是私钥和公钥的通用名称。因此,无论哪种方式,它都会在正确的文件夹(.ssh)中找到适当的密钥。再次感谢。
【解决方案2】:

执行“man sshd”并阅读 AUTHORIZED_KEYS FILE FORMAT 部分。

【讨论】:

    猜你喜欢
    • 2012-03-05
    • 2013-11-27
    • 2018-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-03-22
    • 1970-01-01
    • 2014-06-17
    相关资源
    最近更新 更多