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

时间:2015-01-22 15:40:37

标签: 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

1 个答案:

答案 0 :(得分:0)

好的,这是由于我对ssh键的无知。

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

所以我新生成了我的rsa密钥,通过我的酒吧密钥和中提琴发送,我们很高兴。