Sign up ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

How to change key size in OpenSSH? I would like to change it from 1024 key size length to 512.

share|improve this question

2 Answers 2

I am pretty sure this is what you are after. You need to use ssh-keygen.

ssh-keygen -t rsa -b 512

this should create a 512 rsa crypto key

share|improve this answer

There's also a ServerKeyBits option in sshd_config, can set that to a minimum of 512.

share|improve this answer
That's only used for legacy SSH-1 connections, and is not used with SSH-2. – IQAndreas May 30 at 23:52

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.