SSH полностью игнорирует файл идентификации, который я указал в моем файле .ssh / config
, и не будет использовать этот ключ для аутентификации на моем рабочем сервере. Это мой файл конфигурации
:
Host *
# This is to fix check_host_cert: certificate signature algorithm ssh-rsa: signature algorithm not supported
# I tried putting this under *.work but it didn't work, so I put it under *
CASignatureAlgorithms ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,ssh-ed25519,rsa-sha2-512,rsa-sha2-256,ssh-rsa
Host *.work
ProxyJump bastion.work.com
User myusername
IdentityFile ~/.ssh/work
Compression yes
Точно такая же конфигурация работает в моей установке Ubuntu 18.04, но не будет работать в моей подсистеме Ubuntu 20.04 Windows 10 вообще. Я запустил ssh
с -vvv
, и я вижу, что он читает файл конфигурации и распознает ключ, но не пытается его:
debug1: Reading configuration data /home/myusername/.ssh/config
debug1: /home/myusername/.ssh/config line 1: Applying options for *
debug1: /home/myusername/.ssh/config line 4: Applying options for *.work
debug1: Reading configuration data /etc/ssh/ssh_config
...
debug1: identity file /home/myusername/.ssh/work type 0
debug1: identity file /home/myusername/.ssh/work-cert type -1
...
debug1: Next authentication method: publickey
debug1: Trying private key: /home/myusername/.ssh/id_rsa
debug3: no such identity: /home/myusername/.ssh/id_rsa: No such file or directory
debug1: Trying private key: /home/myusername/.ssh/id_dsa
debug3: no such identity: /home/myusername/.ssh/id_dsa: No such file or directory
debug1: Trying private key: /home/myusername/.ssh/id_ecdsa
debug3: no such identity: /home/myusername/.ssh/id_ecdsa: No such file or directory
debug1: Trying private key: /home/myusername/.ssh/id_ecdsa_sk
debug3: no such identity: /home/myusername/.ssh/id_ecdsa_sk: No such file or directory
debug1: Trying private key: /home/myusername/.ssh/id_ed25519
debug3: no such identity: /home/myusername/.ssh/id_ed25519: No such file or directory
debug1: Trying private key: /home/myusername/.ssh/id_ed25519_sk
debug3: no such identity: /home/myusername/.ssh/id_ed25519_sk: No such file or directory
debug1: Trying private key: /home/myusername/.ssh/id_xmss
debug3: no such identity: /home/myusername/.ssh/id_xmss: No such file or directory
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
myusername@bastion.work.com: Permission denied (publickey).
kex_exchange_identification: Connection closed by remote host
Он просто никогда не пытается / home / myusername / .ssh / work
. Как я могу явно попросить ssh использовать его?
РЕДАКТИРОВАТЬ: С сегодняшнего дня (01.07.20) точно такая же проблема началась и с моей установкой Ubuntu 18.04. Что-то изменилось в OpenSSL?
РЕДАКТИРОВАТЬ (17.06.21): Я должен упомянуть, что когда-то после того, как проблема исчезла сама по себе, возможно, этот вопрос будет полезен другим людям.
https://help.okta.com/en/prod/Content/Topics/Adv_Server_Access/docs/sftd-ubuntu.htm
Для серверов с Ubuntu 20.04 необходимо разрешить центры сертификации (ЦС) для использования алгоритма ssh-rsa для подписи сертификатов. Для этого добавьте следующую строку в файл демона OpenSSH (это либо /etc/ssh/sshd_config, либо вставной файл в /etc/ssh/sshd_config.d/)
Чтобы это исправить, добавьте следующие 2 строки в /etc/ssh/sshd_config
TrustedUserCAKeys /etc/ssh/xxxxxx
CASignatureAlgorithms +ssh-rsa
Замените xxxxxxx открытым ключом, который вы можете найти в /etc/ssh