ssh 甚至无法访问 ~/.ssh/authorized_keys



这是设置。

直到 24 小时前,无密码 ssh 登录的密钥工作正常。我们用了整点。

然后我不小心运行了这个命令ssh-keygen -e -f ~/.ssh/id_rsa > ~/.ssh/id_dsa_com.pub

从那以后,我的两个服务器都无法访问 sftp 服务器而不提示输入密码。

SELinux 是允许的或禁用

以下是权限:

[user@localserver .ssh]$ l total 32 drwx------. 2 user user 4096 Jan 22 09:24 . drwx------. 4 user user 4096 Jan 22 09:24 .. -rw-r--r--. 1 user user 742 Jan 21 16:32 authorized_keys -rw-------. 1 user user 668 Jan 21 16:25 id_dsa -rw-r--r--. 1 user user 612 Jan 21 16:25 id_dsa.pub -rw-------. 1 user user 1675 Jan 21 16:39 id_rsa -rw-r--r--. 1 user user 404 Jan 21 16:39 id_rsa.pub -rw-rw-rw-. 1 user user 252 Jan 21 16:21 known_hosts

当我使用 -vvv 打开调试时,它甚至不看我的authorized_keys文件:

Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred gssapi-keyex,gssapi-with-mic,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: Trying private key: /home/user/.ssh/identity
debug3: no such identity: /home/user/.ssh/identity
debug1: Offering public key: /home/user/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug3: Wrote 384 bytes for a total of 1781
debug1: Authentications that can continue: publickey,password
debug1: Offering public key: /home/user/.ssh/id_dsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug3: Wrote 528 bytes for a total of 2309
debug1: Authentications that can continue: publickey,password
debug2: we did not send a packet, disable method
debug3: authmethod_lookup password
debug3: remaining preferred: ,password
debug3: authmethod_is_enabled password
debug1: Next authentication method: password
好吧,

这是由于我对 ssh 密钥的无知。

我把我的酒吧钥匙寄给了他们。这就是为什么远程服务器无法接受我的 rsa pub 的原因,因为我用我所做的"毁了"我的 rsa 密钥。

所以我重新生成了我的 rsa 密钥,发送了我的公共密钥,中提琴,我们很好。

相关内容

  • 没有找到相关文章

最新更新