Windows OpenSSH 公钥问题

Windows OpenSSH 公钥问题

我已经尽力配置我的 ssh 服务器,尽管每次我尝试使用公钥授权登录时,都会出现服务器拒绝公钥签名,尽管接受了密钥。

我曾经ssh-keygen生成一个密钥对,然后将公钥加载到authorised_keys中,并将私钥发送到另一个帐户并使用putty进行转换。

不幸的是,我已尽力查看日志,但没有任何结果,如果可能的话请提供帮助:

4188 21:06:43:039 debug3: socket:320, io:00000293E1AE1570, fd:5 
4188 21:06:43:039 debug3: fd 5 is not O_NONBLOCK
4188 21:06:43:039 debug3: pipe - r-h:332,io:00000293E1B0AC50,fd:6  w-h:260,io:00000293E1B0AD00,fd:7
4188 21:06:43:039 debug3: spawning C:\\Windows\\System32\\openssh\\sshd.exe
4188 21:06:43:052 debug3: Register child 0000000000000154 pid 6216, 0 zombies of 0
4188 21:06:43:052 debug3: close - io:00000293E1AE1570, type:1, fd:5, table_index:5
4188 21:06:43:052 debug1: Forked child 6216.
4188 21:06:43:052 debug3: close - io:00000293E1B0AD00, type:2, fd:7, table_index:7
6216 21:06:43:130 debug1: sshd version OpenSSH_7.5, without OpenSSL
6216 21:06:43:131 debug3: open - handle:0000000000000114, io:000001BDD87B1790, fd:3
6216 21:06:43:133 debug3: close - io:000001BDD87B1790, type:2, fd:3, table_index:3
6216 21:06:43:133 debug1: private host key #0: ssh-ed25519 SHA256:NjgKQSG8Ij4NAF1BFLVudb+dZoMpZMmOUPozaHmbFz4
6216 21:06:43:137 debug1: child socket: 320
6216 21:06:43:137 debug1: child startup_pipe: 260
6216 21:06:43:138 Connection from 192.168.1.3 port 49196 on 192.168.1.7 port 22
6216 21:06:43:138 debug1: Client protocol version 2.0; client software version PuTTY_Release_0.70
6216 21:06:43:138 debug1: no match: PuTTY_Release_0.70
6216 21:06:43:138 debug1: Local version string SSH-2.0-OpenSSH_7.5
6216 21:06:43:138 debug2: fd 3 setting O_NONBLOCK
6216 21:06:43:138 debug1: list_hostkey_types: ssh-ed25519
6216 21:06:43:141 debug3: send packet: type 20
6216 21:06:43:141 debug1: SSH2_MSG_KEXINIT sent
6216 21:06:43:143 debug3: receive packet: type 20
6216 21:06:43:143 debug1: SSH2_MSG_KEXINIT received
6216 21:06:43:144 debug2: local server KEXINIT proposal
6216 21:06:43:144 debug2: KEX algorithms: curve25519-sha256,[email protected]
6216 21:06:43:144 debug2: host key algorithms: ssh-ed25519
6216 21:06:43:144 debug2: ciphers ctos: [email protected],aes128-ctr,aes192-ctr,aes256-ctr
6216 21:06:43:144 debug2: ciphers stoc: [email protected],aes128-ctr,aes192-ctr,aes256-ctr
6216 21:06:43:144 debug2: MACs ctos: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
6216 21:06:43:144 debug2: MACs stoc: [email protected],[email protected],[email protected],[email protected],[email protected],[email protected],[email protected],hmac-sha2-256,hmac-sha2-512,hmac-sha1
6216 21:06:43:144 debug2: compression ctos: none
6216 21:06:43:144 debug2: compression stoc: none
6216 21:06:43:144 debug2: languages ctos: 
6216 21:06:43:144 debug2: languages stoc: 
6216 21:06:43:144 debug2: first_kex_follows 0 
6216 21:06:43:144 debug2: reserved 0 
6216 21:06:43:144 debug2: peer client KEXINIT proposal
6216 21:06:43:144 debug2: KEX algorithms: [email protected],ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group-exchange-sha1,diffie-hellman-group14-sha1,rsa2048-sha256,rsa1024-sha1,diffie-hellman-group1-sha1
6216 21:06:43:144 debug2: host key algorithms: ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-rsa,ssh-dss
6216 21:06:43:144 debug2: ciphers ctos: aes256-ctr,aes256-cbc,[email protected],aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc,[email protected],blowfish-ctr,blowfish-cbc,3des-ctr,3des-cbc,arcfour256,arcfour128
6216 21:06:43:144 debug2: ciphers stoc: aes256-ctr,aes256-cbc,[email protected],aes192-ctr,aes192-cbc,aes128-ctr,aes128-cbc,[email protected],blowfish-ctr,blowfish-cbc,3des-ctr,3des-cbc,arcfour256,arcfour128
6216 21:06:43:144 debug2: MACs ctos: hmac-sha2-256,hmac-sha1,hmac-sha1-96,hmac-md5,[email protected],[email protected],[email protected],[email protected]
6216 21:06:43:144 debug2: MACs stoc: hmac-sha2-256,hmac-sha1,hmac-sha1-96,hmac-md5,[email protected],[email protected],[email protected],[email protected]
6216 21:06:43:144 debug2: compression ctos: none,zlib
6216 21:06:43:144 debug2: compression stoc: none,zlib
6216 21:06:43:144 debug2: languages ctos: 
6216 21:06:43:144 debug2: languages stoc: 
6216 21:06:43:144 debug2: first_kex_follows 0 
6216 21:06:43:144 debug2: reserved 0 
6216 21:06:43:144 debug1: kex: algorithm: [email protected]
6216 21:06:43:144 debug1: kex: host key algorithm: ssh-ed25519
6216 21:06:43:144 debug1: kex: client->server cipher: aes256-ctr MAC: hmac-sha2-256 compression: none
6216 21:06:43:144 debug1: kex: server->client cipher: aes256-ctr MAC: hmac-sha2-256 compression: none
6216 21:06:43:144 debug1: expecting SSH2_MSG_KEX_ECDH_INIT
6216 21:06:43:149 debug3: receive packet: type 30
6216 21:06:43:153 debug3: send packet: type 31
6216 21:06:43:153 debug3: send packet: type 21
6216 21:06:43:153 debug2: set_newkeys: mode 1
6216 21:06:43:153 debug1: rekey after 4294967296 blocks
6216 21:06:43:153 debug1: SSH2_MSG_NEWKEYS sent
6216 21:06:43:153 debug1: expecting SSH2_MSG_NEWKEYS
6216 21:06:43:445 debug3: receive packet: type 21
6216 21:06:43:445 debug1: SSH2_MSG_NEWKEYS received
6216 21:06:43:445 debug2: set_newkeys: mode 0
6216 21:06:43:445 debug1: rekey after 4294967296 blocks
6216 21:06:43:445 debug1: KEX done
6216 21:06:43:445 debug3: receive packet: type 5
6216 21:06:43:445 debug3: send packet: type 6
6216 21:06:46:862 debug3: receive packet: type 50
6216 21:06:46:862 debug1: userauth-request for user Admin service ssh-connection method none
6216 21:06:46:862 debug1: attempt 0 failures 0
6216 21:06:46:862 debug2: parse_server_config: config reprocess config len 404
6216 21:06:46:863 debug2: input_userauth_request: setting up authctxt for Admin
6216 21:06:46:863 debug2: input_userauth_request: try method none
6216 21:06:46:863 Failed none for Admin from 192.168.1.3 port 49196 ssh2
6216 21:06:46:863 debug3: userauth_finish: failure partial=0 next methods="publickey,keyboard-interactive"
6216 21:06:46:863 debug3: send packet: type 51
6216 21:06:46:864 debug3: receive packet: type 50
6216 21:06:46:864 debug1: userauth-request for user Admin service ssh-connection method publickey
6216 21:06:46:864 debug1: attempt 1 failures 0
6216 21:06:46:864 debug2: input_userauth_request: try method publickey
6216 21:06:46:864 debug1: userauth_pubkey: test whether pkalg/pkblob are acceptable for ED25519 SHA256:GXSt/UnCweDJklx4mgiPkNn4DjHUbEGfpTMlj7HGK8o
6216 21:06:46:864 debug1: trying public key file C:\\Users\\Admin\\.ssh/authorized_keys
6216 21:06:46:865 debug1: matching key found: file C:\\Users\\Admin\\.ssh/authorized_keys, line 1 ED25519 SHA256:GXSt/UnCweDJklx4mgiPkNn4DjHUbEGfpTMlj7HGK8o
6216 21:06:46:865 debug3: send packet: type 60
6216 21:06:46:865 debug2: userauth_pubkey: authenticated 0 pkalg ssh-ed25519
6216 21:06:46:865 Postponed publickey for Admin from 192.168.1.3 port 49196 ssh2
6216 21:06:47:117 debug3: receive packet: type 50
6216 21:06:47:117 debug1: userauth-request for user Admin service ssh-connection method publickey
6216 21:06:47:117 debug1: attempt 2 failures 0
6216 21:06:47:117 debug2: input_userauth_request: try method publickey
6216 21:06:47:117 debug3: userauth_pubkey: have signature for ED25519 SHA256:GXSt/UnCweDJklx4mgiPkNn4DjHUbEGfpTMlj7HGK8o
6216 21:06:47:117 debug1: trying public key file C:\\Users\\Admin\\.ssh/authorized_keys
6216 21:06:47:117 debug1: matching key found: file C:\\Users\\Admin\\.ssh/authorized_keys, line 1 ED25519 SHA256:GXSt/UnCweDJklx4mgiPkNn4DjHUbEGfpTMlj7HGK8o
6216 21:06:47:117 debug3: socket:0, socktype:1, io:000001BDD8805290, fd:5 
6216 21:06:47:138 debug2: userauth_pubkey: authenticated 0 pkalg ssh-ed25519
6216 21:06:47:138 Failed publickey for Admin from 192.168.1.3 port 49196 ssh2: ED25519 SHA256:GXSt/UnCweDJklx4mgiPkNn4DjHUbEGfpTMlj7HGK8o
6216 21:06:47:138 debug3: userauth_finish: failure partial=0 next methods="publickey,keyboard-interactive"
6216 21:06:47:138 debug3: send packet: type 51
6216 21:06:47:139 debug3: receive packet: type 50
6216 21:06:47:139 debug1: userauth-request for user Admin service ssh-connection method keyboard-interactive
6216 21:06:47:139 debug1: attempt 3 failures 1
6216 21:06:47:139 debug2: input_userauth_request: try method keyboard-interactive
6216 21:06:47:139 debug1: keyboard-interactive devs 
6216 21:06:47:139 debug1: auth2_challenge: user=Admin devs=
6216 21:06:47:139 debug1: kbdint_alloc: devices ''
6216 21:06:47:139 debug2: auth2_challenge_start: devices 
6216 21:06:47:139 Failed keyboard-interactive for Admin from 192.168.1.3 port 49196 ssh2
6216 21:06:47:139 debug3: userauth_finish: failure partial=0 next methods="publickey,keyboard-interactive"
6216 21:06:47:139 debug3: send packet: type 51
6216 21:06:47:140 debug3: receive packet: type 1
6216 21:06:47:140 error: Received disconnect from 192.168.1.3 port 49196:14: No supported authentication methods available
6216 21:06:47:140 Disconnected from authenticating user Admin 192.168.1.3 port 49196
6216 21:06:47:140 debug1: do_cleanup
4188 21:06:47:142 debug3: close - io:00000293E1B0AC50, type:2, fd:6, table_index:6
4188 21:06:47:153 debug3: zombie'ing child at index 0, 0 zombies of 1
4188 21:06:47:153 debug3: Unregister child at index 0, 1 zombies of 1

进一步检查上述日志后,我发现,第一次使用公钥后,它被推迟了,然后再次尝试后又失败了。有人知道是什么原因导致这些推迟(或最终失败)吗?

编辑:根据以下评论更新主机密钥列表。

相关内容