SSH flat out ignores the identity file I've specified in my .ssh/config
file and will not use that key to authenticate with my work server. This is my config
file:
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
This exact same configuration works on my Ubuntu 18.04 installation but will not work on on my Ubuntu 20.04 Windows 10 subsystem at all. I ran ssh
with -vvv
and I can see that it reads the config file and recognises the key but doesn't try it:
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
It just never tries /home/myusername/.ssh/work
. How can I explicitly ask ssh to use it?
EDIT: From today (01/07/20) the exact same issue has started happening on my Ubuntu 18.04 installation too. Has something changed in OpenSSL?
EDIT (17/06/21): I should mention that sometime after the issue just happened to disappear on its own, but maybe this question would be useful to other people.
ls -lar ~/.ssh
. You should have octal permisions 700 (drwx------
) for the directories and 600 (-rw-------
) for the files. – pa4080 Oct 21 '20 at 21:06