Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crypto-policies Option "min rsa size" not working in AlmaLinux 8 #179

Open
5u5ann9 opened this issue Nov 11, 2023 · 0 comments
Open

Crypto-policies Option "min rsa size" not working in AlmaLinux 8 #179

5u5ann9 opened this issue Nov 11, 2023 · 0 comments

Comments

@5u5ann9
Copy link

5u5ann9 commented Nov 11, 2023

Hello,

regadless of the Crypto-policy set, it is possible to login with a rsa 1024 key.

I think this is possibly due to the OpenSSH version installed in Almalinux 8.
The "min rsa size" in the Crypto-Policies set the value for the option "RequiredRSASize" in OpenSSH configuration, but this option was just implemented in OpenSSH version 9.0.
Fedora 37 has implementet the patch openssh-server-8.8p1-7.fc37 which fixed the issue.

Steps to reproduce:

  • generate an rsa 1024 key and copy this to the server
ssh-keygen -t rsa -b 1024 -f ~/.ssh/cp_rsa1024
ssh-copy-id -i ~/.ssh/crypt_1024rsa.pub root@almalinux8
  • set crypto-policy to something bigger then LEGACY
update-crypto-policies --set Default
reboot
  • login with the 1024key
ssh -i ~/.ssh/crypt_1024rsa root@root@almalinux8 -v

expected behavior:

debug1: Offering public key: .ssh/crypt_1024rsa RSA SHA256:hkpFBRW/y76PZlG903lf1POqZ90DQfFoRfpqFqD/BwY explicit,
debug1: Authentications that can continue: publickey,gssapi-keyex,gssapi-with-mic,password,
debug1: Next authentication method: password
root@root@almalinux8 password

actual behavior:

debug1: Next authentication method: publickey
debug1: Offering public key: .ssh/crypt_1024rsa RSA SHA256:hkpFBRW/y76PZlG903lf1POqZ90DQfFoRfpqFqD/BwY explicit,
debug1: Server accepts key: .ssh/crypt_1024rsa RSA SHA256:hkpFBRW/y76PZlG903lf1POqZ90DQfFoRfpqFqD/BwY explicit,
debug1: Authentication succeeded (publickey).
Authenticated to almalinux8 ([**.**.**.**]:22).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant