无法使用公钥但可以使用密码连接 WSL

无法使用公钥但可以使用密码连接 WSL

我刚刚设置了我的 WSL 几天,sshd直到今天 WSL 一直运行良好。(公钥和密码都很好)

现在,我无法通过公钥连接到 WSL,但密码可以。

我使用 frp 设置一个端口,以便通过该端口连接到我的 WSL。

我尝试重新启动 sshd:sudo service ssh --full-restart和 frpc/frps,但问题仍然存在。

authorized_keys文件未被修改,并且由其~/.ssh目录中的正确用户拥有,并且sshd_config似乎没有问题,因为我使用另一台 ubuntu 服务器(但不是 wsl)检查过。

我尝试ssh -vvv并粘贴以下输出

debug1: Found key in C:\\Users\\64687/.ssh/known_hosts:16
debug3: send packet: type 21
debug2: set_newkeys: mode 1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug3: receive packet: type 21
debug1: SSH2_MSG_NEWKEYS received
debug2: set_newkeys: mode 0
debug1: rekey after 134217728 blocks
debug3: unable to connect to pipe \\\\.\\pipe\\openssh-ssh-agent, error: 2
debug1: pubkey_prepare: ssh_get_authentication_socket: No such file or directory
debug2: key: .ssh/id_rsa (00000xxxxxxxx), explicit
debug3: send packet: type 5
debug3: receive packet: type 7
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,[email protected],ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,[email protected]>
debug3: receive packet: type 6
debug2: service_accept: ssh-userauth
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug3: send packet: type 50
debug3: receive packet: type 51
debug1: Authentications that can continue: publickey,password
debug3: start over, passed a different list publickey,password
debug3: preferred 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: Offering public key: RSA SHA256:xxxxxxxxxxxxx .ssh/id_rsa
debug3: send_pubkey_test
debug3: send packet: type 50
debug2: we sent a publickey packet, wait for reply
debug3: receive packet: type 51
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

相关内容