【发布时间】:2016-11-08 12:21:35
【问题描述】:
服务器新手在这里和mac上供参考。
所以我试图打破我和我的 LAMP 堆栈之间的 ssh 密钥身份验证,尽管我做不到。换句话说,它只是让我访问,我不知道如何!这是我所做的......
- 通过终端创建密钥:
ssh-keygen -f foo_key - 将 pub 密钥粘贴到我服务器上的正确位置...
- 通过终端 SSH 进入:
ssh -i /Users/me/.ssh/foo_key root@x.x.x.x - 要求输入我在设置时选择的密码,输入正确。
所以现在我可以访问了,接下来我从我的服务器logout。现在我想摆脱这台计算机上的访问权限。我试过删除我的本地私钥和公钥,我试过删除known_hosts 中的校验和,我试过找到一个保存在keychain access 中的密钥,那里什么都没有。
那么这个认证信息到底保存在哪里了,真是烦人啊。
感谢所有指导。
编辑
这里有一些详细信息,现在似乎根本没有使用我的foo_key:
debug1: identity file /Users/me/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /Users/me/.ssh/id_ed25519-cert type -1
没有关于它最初提供的 RSA 密钥的准确信息:
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Offering RSA public key:
debug1: Authentications that can continue: publickey,password
debug1: Offering RSA public key:
debug1: Server accepts key: pkalg ssh-rsa blen 279
debug1: Authentication succeeded (publickey).
另一个更新
运行 -vvv 并没有给我任何比我已经发布的更有意义的信息。我不知道这是否与它有关,但我在~/.ssh/ 中没有authorized_keys 文件。我创建了一个并生成了一些新密钥,其中没有存储任何内容。
我只需要知道为什么即使我已经删除了我在机器上生成的密钥的所有证据,我仍然可以继续访问我的服务器。不敢相信这不常见!?
值得注意的是,我没有默认使用 id_rsa 键,我专门创建自定义键并希望继续使用它们。
【问题讨论】:
-
发布详细日志。它会告诉你那里发生了什么。
-
我发了一些,有用吗?
-
您正在使用某个密钥进行身份验证。使用
-vvv应该会为您提供更多信息,并希望它还能从哪里获取密钥。 -
嗯,再次感谢,但没有任何有意义的事情。