你好,
我在 Fedora 23 安装后遇到了 SSH 的问题。
当我想要使用私钥连接到我的远程主机时,我的主机找到了这把密钥:
debug1: matching key found: file /home/theo/.ssh/authorized_keys, line 1 RSA {REDACTED}
debug1: restore_uid: 0/0
Postponed publickey for theo from {REDACTED} port 60351 ssh2 [preauth]
Connection closed by {REDACTED} [preauth]
debug1: do_cleanup [preauth]
debug1: monitor_read_log: child log fd closed
但是你看,我的客户端自己断开了连接
debug3: remaining preferred: keyboard-interactive,password
debug3: authmethod_is_enabled publickey
debug1: Next authentication method: publickey
debug1: Offering RSA public key: /home/tbouge/.ssh/id_rsa
debug3: send_pubkey_test
debug2: we sent a publickey packet, wait for reply
debug1: Server accepts key: pkalg ssh-rsa blen 1047
debug2: input_userauth_pk_ok: fp SHA256:{REDACTED}
debug3: sign_and_send_pubkey: RSA SHA256:{REDACTED}
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
Permission denied (publickey).
我可以使用Putty在Windows上使用相同的私钥连接到我的主机,也可以使用不同的私钥连接到我的手机。
你有什么想法吗?
/etc/ssh/ssh_conf
Host *
GSSAPIAuthentication yes
# If this option is set to yes then remote X11 clients will have full access
# to the original X11 display. As virtually no X11 client supports the untrusted
# mode correctly we set this to yes.
ForwardX11Trusted yes
# Send locale-related environment variables
SendEnv LANG LC_CTYPE LC_NUMERIC LC_TIME LC_COLLATE LC_MONETARY LC_MESSAGES
SendEnv LC_PAPER LC_NAME LC_ADDRESS LC_TELEPHONE LC_MEASUREMENT
SendEnv LC_IDENTIFICATION LC_ALL LANGUAGE
SendEnv XMODIFIERS
谢谢
编辑:我可以用密码连接
ausearch -m SECCOMP或ausearch -m AVC命令来查找。最近有一些变更可能会影响某些设置。 - Jakujessh命令行是什么?你在使用代理吗?如果你在使用代理,你可以尝试在命令前加上SSH_AUTH_SOCK=来去除代理。 - kasperd