小编Mar*_*tin的帖子

ssh - 为什么不尝试我的私钥?

我正在尝试使用位于 的私钥连接到远程 SSH 服务器~/.ssh/id_rsa。当我ssh -v到服务器时,我得到以下信息:

...
debug1: Authentications that can continue: publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/martin/.ssh/id_rsa
debug1: Authentications that can continue: publickey
debug1: Offering RSA public key: martin@martin
debug1: Authentications that can continue: publickey
debug1: Trying private key: /home/martin/.ssh/id_dsa
debug1: Trying private key: /home/martin/.ssh/id_ecdsa
debug1: Trying private key: /home/martin/.ssh/id_ed25519
debug1: No more authentication methods to try.
Permission denied (publickey).
Run Code Online (Sandbox Code Playgroud)

查看输出,似乎它甚至没有尝试我的私钥。我试过编辑 ~/.ssh/config,使用该-i选项,通过添加密钥ssh-add,但没有任何效果。

我确信公钥已正确安装在远程服务器上。任何人都可以帮助我吗?

编辑:

martin@martin:~/.ssh$ ls …
Run Code Online (Sandbox Code Playgroud)

ssh rsa private-key

6
推荐指数
1
解决办法
2万
查看次数

标签 统计

private-key ×1

rsa ×1

ssh ×1