swift-nio-ssh deliberately supports modern key types only, so it can't sign in with RSA keys. That's a sensible default, but it left me stuck: older Amazon EC2 key pairs are RSA .pem files, and the machines they open are still around. So I forked it and added RSA client authentication (rsa-sha2-512): GitHub - lograker/swift-nio-ssh: RSA client authentication for swift-nio-ssh, so a Swift SSH client can use the PKCS#1 RSA .pem keys Amazon EC2 issues. Fork of apple/swift-nio-ssh 0.15.0. No support. · GitHub
To be clear, this isn't a request to merge it upstream. I understand why RSA was left out. It's for anyone who hits the same wall.
The part worth knowing even if you never touch the fork: RSA is the one algorithm where the key's type (ssh-rsa) and the signature algorithm's name (rsa-sha2-512) differ. The algorithm name is written twice, in the userauth message and in the data you sign, and the two must match byte for byte. If they don't, every signature is valid, the key is right, and the server still refuses you, with nothing pointing at the cause. A test now pins the two together.
The fork is based on 0.15.0 (tag 0.15.0-rsa.2). Every change is marked LOGRAKER FORK:, so the diff is one grep, and a test compares the public-key encoding byte for byte with ssh-keygen -y. It requires swift-crypto 4.5.1 and swift-nio 2.100.0 or later, to stay clear of recent advisories. It hasn't been audited; please read its README before depending on it. The longer write-up: Adding RSA Support to swift-nio-ssh - LogRaker Blog
Happy to answer questions.