how to generate a small RSA key
I want to ssh-keygen -t rsa -b 512
but my linux is too "up to date" to allow this. Is there anyway to modify the settings to:
- generate a 512bit key
- let me authenticate to the server with that key
Yes I know its bad security practice but I am actually doing some security research. This machine will be burnt and has nothing of value. This is pure for research
If it's only for research ... run the old versions in a container. According to the OpenSSH release notes support for 512bit keys was removed in version 8.2, so you need 8.1 or older. There are several containers available with older versions on docker hub.
You will need old versions of both the client and the server.
There is no way in standard ssh-keygen to do this. But you can download source code from https://github.com/openssh/openssh-portable and recompile it with SSH_RSA_MINIMUM_MODULUS_SIZE
set to 512 bits instead of its current value. You can find this const variable in sshkey.h
header file.