SSH-соединение запрашивает пароль, даже если я предоставляю сгенерированный Privatekey в Windows
Я пытаюсь установить соединение с машиной Windows, используя пары ключей RSA. Я сгенерировал пары ключей, используя ssh -keygen
(Ключи длиной 4096 бит), а также скопировал мой открытый ключ в users/myuser/.ssh/authorized_keys, а также установил разрешения, выполнив следующую команду:
ssh --% user1@domain1@contoso.com powershell -c $ConfirmPreference = 'None'; Repair-AuthorizedKeyPermissionC:\Users\user1\.ssh\authorized_keys
Когда я пытаюсь подключиться к этому серверу с помощью агента ssh или с помощью putty с закрытым ключом, он запрашивает пароль и не выполняет аутентификацию на основе ключей. Я пробовал разные подходы, но не знаю. Может кто-нибудь сказать мне, что я здесь делаю не так?
Пожалуйста, найдите журнал ниже:
PS C:\users\vkode200\.ssh> ssh -v vkode200@HQSWL-1615314
OpenSSH_for_Windows_7.9p1, LibreSSL 2.6.5
debug1: Connecting to hqswl-1615314 [fe80::12cd%47] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\vkode200/.ssh/id_rsa type -1
debug1: identity file C:\\Users\\vkode200/.ssh/id_rsa-cert type -1
debug1: identity file C:\\Users\\vkode200/.ssh/id_dsa type -1
debug1: identity file C:\\Users\\vkode200/.ssh/id_dsa-cert type -1
debug1: identity file C:\\Users\\vkode200/.ssh/id_ecdsa type -1
debug1: identity file C:\\Users\\vkode200/.ssh/id_ecdsa-cert type -1
debug1: identity file C:\\Users\\vkode200/.ssh/id_ed25519 type -1
debug1: identity file C:\\Users\\vkode200/.ssh/id_ed25519-cert type -1
debug1: identity file C:\\Users\\vkode200/.ssh/id_xmss type -1
debug1: identity file C:\\Users\\vkode200/.ssh/id_xmss-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_7.9
debug1: match: OpenSSH_for_Windows_7.9 pat OpenSSH* compat 0x04000000
debug1: Authenticating to hqswl-1615314:22 as 'vkode200'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:b3Ij4O5n6NA93BktVQSIqZHLrLGba6wZfpm25utMRSY
debug1: Host 'hqswl-1615314' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\vkode200/.ssh/known_hosts:1
Warning: Permanently added the ECDSA host key for IP address 'fe80::12cd%47' to the list of known hosts.
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: vkode200@CABLE@HQSWL-1615314 ED25519 SHA256:ab7l+m/NoV2p3a8bB4Aqy9ocgqcM48p9czneTRZ3PVE agent
debug1: Will attempt key: cable\\vkode200@HQSWL-1615314 RSA SHA256:HIxB9YslBxVqaKVG8rpCi1iww6jLtf4RSqdhqfdY11Q agent
debug1: Will attempt key: C:\\Users\\vkode200/.ssh/id_rsa
debug1: Will attempt key: C:\\Users\\vkode200/.ssh/id_dsa
debug1: Will attempt key: C:\\Users\\vkode200/.ssh/id_ecdsa
debug1: Will attempt key: C:\\Users\\vkode200/.ssh/id_ed25519
debug1: Will attempt key: C:\\Users\\vkode200/.ssh/id_xmss
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: vkode200@CABLE@HQSWL-1615314 ED25519 SHA256:ab7l+m/NoV2p3a8bB4Aqy9ocgqcM48p9czneTRZ3PVE agent
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: cable\\vkode200@HQSWL-1615314 RSA SHA256:HIxB9YslBxVqaKVG8rpCi1iww6jLtf4RSqdhqfdY11Q agent
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Trying private key: C:\\Users\\vkode200/.ssh/id_rsa
debug1: Trying private key: C:\\Users\\vkode200/.ssh/id_dsa
debug1: Trying private key: C:\\Users\\vkode200/.ssh/id_ecdsa
debug1: Trying private key: C:\\Users\\vkode200/.ssh/id_ed25519
debug1: Trying private key: C:\\Users\\vkode200/.ssh/id_xmss
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such file or directory
vkode200@hqswl-1615314's password:
Пожалуйста, найдите ниже журнал после прохождения пути закрытого ключа:
PS C:\users\vkode200\.ssh> ssh -v -i "C:\Users\vkode200\.ssh\sud_key" vkode200@HQSWL-1615314
OpenSSH_for_Windows_7.9p1, LibreSSL 2.6.5
debug1: Connecting to hqswl-1615314 [fe80::5a%8] port 22.
debug1: Connection established.
debug1: identity file C:\\Users\\vkode200\\.ssh\\sud_key type 0
debug1: identity file C:\\Users\\vkode200\\.ssh\\sud_key-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.9
debug1: Remote protocol version 2.0, remote software version OpenSSH_for_Windows_7.9
debug1: match: OpenSSH_for_Windows_7.9 pat OpenSSH* compat 0x04000000
debug1: Authenticating to hqswl-1615314:22 as 'vkode200'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:b3Ij4O5n6NA93BktVQSIqZHLrLGba6wZfpm25utMRSY
debug1: Host 'hqswl-1615314' is known and matches the ECDSA host key.
debug1: Found key in C:\\Users\\vkode200/.ssh/known_hosts:1
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: Will attempt key: C:\\Users\\vkode200\\.ssh\\sud_key RSA SHA256:HIxB9YslBxVqaKVG8rpCi1iww6jLtf4RSqdhqfdY11Q explicit agent
debug1: Will attempt key: vkode200@CABLE@HQSWL-1615314 ED25519 SHA256:ab7l+m/NoV2p3a8bB4Aqy9ocgqcM48p9czneTRZ3PVE agent
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: C:\\Users\\vkode200\\.ssh\\sud_key RSA SHA256:HIxB9YslBxVqaKVG8rpCi1iww6jLtf4RSqdhqfdY11Q explicit agent
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Offering public key: vkode200@CABLE@HQSWL-1615314 ED25519 SHA256:ab7l+m/NoV2p3a8bB4Aqy9ocgqcM48p9czneTRZ3PVE agent
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: keyboard-interactive
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: password
debug1: read_passphrase: can't open /dev/tty: No such file or directory
vkode200@hqswl-1615314's password: