-1

这是设置。

直到 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
4

1 回答 1

0

好的,这是由于我对 ssh 密钥一无所知。

我向他们发送了我的 pub 密钥。这就是为什么远程服务器无法接受我的 rsa pub 的原因,因为我所做的事情“破坏”了我的 rsa 密钥。

所以我重新生成了我的 rsa 密钥,发送了我的 pub 密钥和中提琴,我们很高兴。

于 2015-01-23T16:21:23.090 回答