How to set minimum size of accepted rsa key

Damien Miller djm at mindrot.org
Thu Jul 11 10:50:30 EST 2013


On Wed, 10 Jul 2013, RAVI PRATAP Singh wrote:

> Hi eveyone,
> 
> Is there a way to set the minimum size accepted by sshd as an RSA public
> key?
> 
> I want to restrict users to using RSA keys that are generated with
> ssh-keygen -b 2048 or greater.
> 
> I didn't see any option in sshd_config. There is a ServerKeyBits option,
> but that seems to apply only for SSHv1.

You can set it at compile time only:

ssh.h:#define SSH_RSA_MINIMUM_MODULUS_SIZE      768

-d


More information about the openssh-unix-dev mailing list