Open stefanfritsch opened 2 years ago
We ran into this as well, but only with Ubuntu 20.04 nodes not Ubuntu 18.04 nodes.
I'm using RKE v1.3.10.
@stefanlasiewski - It's interesting that the server side makes a difference - as ssh
from the command line works fine, it's clearly a client (rke
) issue but there must be some snafu with the accepted algorithms. I know that openssh for windows (the client not the server) needs PubkeyAcceptedAlgorithms +ssh-rsa-cert-v01@openssh.com
in the ~/.ssh/config
even if the certificates are rsa-sha2-256
.
Could it be related to golang/go/issues/37278?
We are experiencing a similar issue -- I can confirm that the root cause is a change in the crypto/ssh library -- certificate-based login (with ssh-rsa certs) works fine for versions of crypto/ssh before commit 3147a52a75dd
, but is broken after. As best I can tell, the issue is with client_auth.go
, in the function pickSignatureAlgorithm
. Previously, the library would fail to find a common certificate algo, and would attempt whatever your certificate was as a last-ditch effort. Now, it identifies certificate algos the server should support based on supported key exchange algos, which then include ssh-rsa2-512, ssh-rsa2-256, and ssh-rsa. This sounds like it shouldn't be an issue, since that includes the certificate I want to use, but it does decide on an ssh-rsa2 algo when the cert is ssh-rsa. Why this breaks is not clear, since presumably an ssh-rsa cert can still sign using ssh-rsa2.
So what makes this an RKE issue and not an ssh issue? I suspect, but do not know for certain, that this is a usage issue, mostly because that's the default assumption to make. However, x/crypto is (somewhat unbelievably) still in version 0, so it is deliberately advertising that it is not yet stable. I simply don't have the time to establish confidently where the issue truly lies, especially considering the apparent lack of documentation of x/crypto/ssh.
I had luck switching from an RSA key to a ed25519 key (After talking to Rancher support). The upstream Go issue suggests that Go support for RSA keys is broken: https://github.com/golang/go/issues/49952
Also, I notice this issue is discussing certs while my problem is with keys. However, I suspect the underlying cause is the same, and any non-RSA key should work.
This repository uses an automated workflow to automatically label issues which have not had any activity (commit/comment/label) for 60 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the workflow can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the workflow will automatically close the issue in 14 days. Thank you for your contributions.
@stefanfritsch @Birddude1230 With rke v1.3.14, SSH now works for me. Is it working for you also?
@stefanlasiewski Can't confirm for v1.3.15. With an ed25519 private key (ca-key is always rsa) I get:
WARN[0000] Failed to set up SSH tunneling for host [shin-11]: Can't retrieve Docker Info: error during connect: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info": Failed to dial ssh using address [shin-11:22]: ssh: handshake failed: agent: unsupported algorithm "ssh-ed25519"
with rsa:
Error: ssh: handshake failed: ssh: unable to authenticate, attempted methods [none publickey], no supported methods remain
In both cases the login with ssh shin-11
works just fine.
@stefanfritsch You know what, I was wrong. it's not working for me either.
This repository uses an automated workflow to automatically label issues which have not had any activity (commit/comment/label) for 60 days. This helps us manage the community issues better. If the issue is still relevant, please add a comment to the issue so the workflow can remove the label and we know it is still valid. If it is no longer relevant (or possibly fixed in the latest release), the workflow will automatically close the issue in 14 days. Thank you for your contributions.
This issue is still happening. Posting a message to keep this issue open.
@stefanlasiewski @stefanfritsch , could you check if adding the following settings to /etc/ssh/sshd_config
resolves the issue for you:
AllowStreamLocalForwarding yes
DisableForwarding no
Context: https://github.com/rancher/rke/issues/2907#issuecomment-1196803472
AllowStreamLocalForwarding yes DisableForwarding no
This had no effect for me. Note that on Ubuntu 20.04, AllowStreamLocalForwarding yes
is already the default according to the manpage. I believe that DisableForwarding no
is also the default, but the manpage isn't clear.
I use ssh certificates to access nodes and this has worked fine for years until at least v1.3.7 but with v1.3.11 (I haven't used the versions in between) it is broken:
The same node works if I add the key to
authorized_keys
Steps to Reproduce:
authorized_keys
: WorksOutput
ssh
Login works
v1.3.7
Everything's fine
v1.3.11
Nothing works
v1.3.11 with the pubkey on one of the hosts
Note how the node with the key in
authorized_keys
now workssshd
System info
RKE version: v1.3.11
Operating system and kernel: (
cat /etc/os-release
,uname -r
preferred)Type/provider of hosts: (VirtualBox/Bare-metal/AWS/GCE/DO): bare-metal
cluster.yml file:
SURE-4777