openssh public-key Permission denied (publickey,keyboard-interactive)
Что я сделал: ssh-keygen -t rsa -b 4096 добавил в authorized_keys отредактировал sshd_config: ``` # This is the sshd server system-wide configuration file. See # sshd_config(5) for more information.
# The strategy used for options in the default sshd_config shipped with
# OpenSSH is to specify options with their default value where
# possible, but leave them commented. Uncommented options override the
# default value.
#Port 22
#AddressFamily any
#ListenAddress 0.0.0.0
#ListenAddress ::
#HostKey __PROGRAMDATA__/ssh/ssh_host_rsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_dsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ecdsa_key
#HostKey __PROGRAMDATA__/ssh/ssh_host_ed25519_key
# Ciphers and keying
#RekeyLimit default none
# Logging
#SyslogFacility AUTH
#LogLevel INFO
# Authentication:
#LoginGraceTime 2m
#PermitRootLogin prohibit-password
#StrictModes yes
#MaxAuthTries 6
#MaxSessions 10
RSAAuthentication yes
PubkeyAuthentication yes
# The default is to check both .ssh/authorized_keys and .ssh/authorized_keys2
# but this is overridden so installations will only check .ssh/authorized_keys
AuthorizedKeysFile .ssh/authorized_keys
#AuthorizedPrincipalsFile none
# For this to work you will also need host keys in %programData%/ssh/ssh_known_hosts
#HostbasedAuthentication no
# Change to yes if you don't trust ~/.ssh/known_hosts for
# HostbasedAuthentication
#IgnoreUserKnownHosts no
# Don't read the user's ~/.rhosts and ~/.shosts files
#IgnoreRhosts yes
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
PermitEmptyPasswords yes
#AllowAgentForwarding yes
#AllowTcpForwarding yes
#GatewayPorts no
#PermitTTY yes
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#PermitUserEnvironment no
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS no
#PidFile /var/run/sshd.pid
#MaxStartups 10:30:100
#PermitTunnel no
#ChrootDirectory none
#VersionAddendum none
# no default banner path
#Banner none
# override default of no subsystems
Subsystem sftp sftp-server.exe
# Example of overriding settings on a per-user basis
#Match User anoncvs
# AllowTcpForwarding no
# PermitTTY no
# ForceCommand cvs server
Match Group administrators
AuthorizedKeysFile __PROGRAMDATA__/ssh/administrators_authorized_keys
Лог на сервере:
```
__PROGRAMDATA__\\ssh/sshd_config line 35: Deprecated option RSAAuthentication
debug1: sshd version OpenSSH_for_Windows_7.7, LibreSSL 2.6.5
debug1: private host key #0: ssh-rsa SHA256:K1DNRfLuoedF8LiyIxPfqIqT/rX44Ol4oEsguOjf7v8
debug1: private host key #1: ecdsa-sha2-nistp256 SHA256:/q6irCl752nFhsKW1bCp7j3bsNK520jsY3mrYAEnfjE
debug1: private host key #2: ssh-ed25519 SHA256:/MUkAQ/Vya2iuxNl6qysEoqTK9q17XmZcSpd/BD4qYk
debug1: rexec_argv[0]='C:\\WINDOWS\\System32\\OpenSSH\\sshd.exe'
debug1: rexec_argv[1]='-d'
debug1: Bind to port 22 on ::.
Server listening on :: port 22.
debug1: Bind to port 22 on 0.0.0.0.
Server listening on 0.0.0.0 port 22.
debug1: Server will not fork when running in debugging mode.
Connection from 192.168.1.185 port 65081 on 192.168.1.219 port 22
debug1: Client protocol version 2.0; client software version OpenSSH_for_Windows_7.7
debug1: match: OpenSSH_for_Windows_7.7 pat OpenSSH* compat 0x04000000
debug1: Local version string SSH-2.0-OpenSSH_for_Windows_7.7
__PROGRAMDATA__\\ssh/sshd_config line 35: Deprecated option RSAAuthentication
debug1: sshd version OpenSSH_for_Windows_7.7, LibreSSL 2.6.5
debug1: list_hostkey_types: ssh-rsa,rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 [preauth]
debug1: SSH2_MSG_KEXINIT sent [preauth]
debug1: SSH2_MSG_KEXINIT received [preauth]
debug1: kex: algorithm: curve25519-sha256 [preauth]
debug1: kex: host key algorithm: ecdsa-sha2-nistp256 [preauth]
debug1: kex: client->server cipher: [email protected] MAC: <implicit> compression: none [preauth]
debug1: kex: server->client cipher: [email protected] MAC: <implicit> compression: none [preauth]
debug1: expecting SSH2_MSG_KEX_ECDH_INIT [preauth]
debug1: rekey after 134217728 blocks [preauth]
debug1: SSH2_MSG_NEWKEYS sent [preauth]
debug1: expecting SSH2_MSG_NEWKEYS [preauth]
debug1: SSH2_MSG_NEWKEYS received [preauth]
debug1: rekey after 134217728 blocks [preauth]
debug1: KEX done [preauth]
debug1: userauth-request for user [email protected] service ssh-connection method none [preauth]
debug1: attempt 0 failures 0 [preauth]
reprocess config line 35: Deprecated option RSAAuthentication
unable to resolve group administrators
debug1: user does not match group list administrators at line 86
debug1: userauth-request for user [email protected] service ssh-connection method publickey [preauth]
debug1: attempt 1 failures 0 [preauth]
debug1: userauth_pubkey: test pkalg rsa-sha2-512 pkblob RSA SHA256:dYgigDiclxz5ls+WXvwk22BngqIOjNuwB06klLweoMA [preauth]
debug1: trying public key file C:\\Users\\alter\\.ssh/authorized_keys
Authentication refused.
Failed publickey for [email protected] from 192.168.1.185 port 65081 ssh2: RSA SHA256:dYgigDiclxz5ls+WXvwk22BngqIOjNuwB06klLweoMA
debug1: userauth-request for user [email protected] service ssh-connection method publickey [preauth]
debug1: attempt 2 failures 1 [preauth]
debug1: userauth_pubkey: test pkalg rsa-sha2-512 pkblob RSA SHA256:F7QT0v4kkiK/FBI/+Ip8GdiP3ruGyY+zX9de7HCZing [preauth]
debug1: trying public key file C:\\Users\\alter\\.ssh/authorized_keys
Authentication refused.
Failed publickey for [email protected] from 192.168.1.185 port 65081 ssh2: RSA SHA256:F7QT0v4kkiK/FBI/+Ip8GdiP3ruGyY+zX9de7HCZing
debug1: userauth-request for user [email protected] service ssh-connection method publickey [preauth]
debug1: attempt 3 failures 2 [preauth]
debug1: userauth_pubkey: test pkalg rsa-sha2-512 pkblob RSA SHA256:w4lIg/OIQLizbw+MG/N3NkeXkxHOIt5tRiR44M8oovo [preauth]
debug1: trying public key file C:\\Users\\alter\\.ssh/authorized_keys
Authentication refused.
Failed publickey for [email protected] from 192.168.1.185 port 65081 ssh2: RSA SHA256:w4lIg/OIQLizbw+MG/N3NkeXkxHOIt5tRiR44M8oovo
debug1: userauth-request for user [email protected] service ssh-connection method keyboard-interactive [preauth]
debug1: attempt 4 failures 3 [preauth]
debug1: keyboard-interactive devs [preauth]
debug1: auth2_challenge: [email protected] devs= [preauth]
debug1: kbdint_alloc: devices '' [preauth]
Connection reset by authenticating user [email protected] 192.168.1.185 port 65081 [preauth]
debug1: do_cleanup [preauth]
debug1: monitor_read_log: child log fd closed
debug1: do_cleanup
debug1: Killing privsep child 8128```