OpenSSH: SSH2 sshd - Increase key size from 2048 to 8192 bits (Cygwin)
- From: purpmint008@xxxxxxxxx
- Date: Wed, 15 Aug 2007 14:04:00 -0000
X-No-Archive: Yes
In short: How do I change OpenSSH's sshd's host-key-pair size from
2048 bits to 8192 bits? I am only using the SSH2 protocol.
I'm using sshd from OpenSSH under Cygwin (XP-Pro).
It works great but I need to increase the size of my (sshd's) keys.
My client's key-pair (PuTTY/PuTTYgen) is 8192 bits long and
is implemented perfectly. However, I need the same key length
to be used by sshd.
I basically want sshd to use keys that are 8192 bits in length.
I know that its default host-key-pair size is 2048. I want to change
this to 8192 bits. I only use the SSH2 protocol so changing the
the server-key-pair size to 8192 bits isn't an option since SSH2 uses
Diffie-Hellman key exchange and does not implement a server-key-pair?:
FROM OPENSSH's MANUAL PAGES:
"The OpenSSH SSH daemon supports SSH protocols 1 and 2. Both
protocols
are supported by default, though this can be changed via the
Protocol op-
tion in sshd_config(5). Protocol 2 supports both RSA and DSA
keys; pro-
tocol 1 only supports RSA keys. For both protocols, each host
has a
host-specific key, normally 2048 bits, used to identify the host.
Forward security for protocol 1 is provided through an additional
server
key, normally 768 bits, generated when the server starts. This
key is
normally regenerated every hour if it has been used, and is never
stored
on disk. Whenever a client connects, the daemon responds with
its public
host and server keys. The client compares the RSA host key
against its
own database to verify that it has not changed. The client then
gener-
ates a 256-bit random number. It encrypts this random number
using both
the host key and the server key, and sends the encrypted number
to the
server. Both sides then use this random number as a session key
which is
used to encrypt all further communications in the session. The
rest of
the session is encrypted using a conventional cipher, currently
Blowfish
or 3DES, with 3DES being used by default. The client selects the
encryp-
tion algorithm to use from those offered by the server.
For protocol 2, forward security is provided through a Diffie-
Hellman key
agreement. This key agreement results in a shared session key.
The rest
of the session is encrypted using a symmetric cipher, currently
128-bit
AES, Blowfish, 3DES, CAST128, Arcfour, 192-bit AES, or 256-bit
AES. The
client selects the encryption algorithm to use from those offered
by the
server. Additionally, session integrity is provided through a
crypto-
graphic message authentication code (hmac-md5, hmac-sha1, umac-64
or
hmac-ripemd160).
Finally, the server and the client enter an authentication
dialog. The
client tries to authenticate itself using host-based
authentication, pub-
lic key authentication, challenge-response authentication, or
password
authentication.
If the client successfully authenticates itself, a dialog for
preparing
the session is entered. At this time the client may request
things like
allocating a pseudo-tty, forwarding X11 connections, forwarding
TCP con-
nections, or forwarding the authentication agent connection over
the se-
cure channel.
After this, the client either requests a shell or execution of a
command.
The sides then enter session mode. In this mode, either side may
send
data at any time, and such data is forwarded to/from the shell or
command
on the server side, and the user terminal in the client side.
When the user program terminates and all forwarded X11 and other
connec-
tions have been closed, the server sends command exit status to
the
client, and both sides exit."
When looking up exactly how SSH works I found out that
the daemon for protocol 1 has two key pairs. The host-key-pair
and the server-key-pair. The host-key-pair is permanent and is used
for both encryption and identification (by the client). The
server-key-pair is generated at a regular interval. The client
generates the AES-256 key randomly, encrypts it using the
public host and server keys and sends it to the sshd.
So this only works under SSH1 and SSH2 uses Diffie-Hellman
key exchange...
The sshd_config file allows me to specify the size of the
server-key pair and as you can see below I've made it 8192
bits long. BUT it says "Lifetime and size of ephemeral version 1
server key"
and the OpenSSH site says ServerKeyBits: "Defines the number of bits
in the ephemeral protocol version 1 server key. The minimum value is
512, and the default is 768."
So does the above only apply to SSH1 which I have disabled through the
sshd_config file?
Here's (part of) my 'sshd_config' file:
Port 51235 [I use one of the dynamic/private ports]
Protocol 2
# HostKeys for protocol version 2
#HostKey /etc/ssh_host_rsa_key
#HostKey /etc/ssh_host_dsa_key
# Lifetime and size of ephemeral version 1 server key [THIS IS
PROTOCOL 1?]
KeyRegenerationInterval 3600
ServerKeyBits 8192
# Authentication:
#LoginGraceTime 2m
PermitRootLogin no
StrictModes no
#MaxAuthTries 6
RSAAuthentication yes
#PubkeyAuthentication yes
AuthorizedKeysFile .ssh/authorized_keys2
# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no
#PermitEmptyPasswords no
# Change to no to disable s/key passwords
#ChallengeResponseAuthentication yes
# [ADDED MANUALLY!] Ciphers:
aes256-cbC
#AllowTcpForwarding yes
#GatewayPorts no
#X11Forwarding no
#X11DisplayOffset 10
X11UseLocalhost no
#PrintMotd yes
#PrintLastLog yes
#TCPKeepAlive yes
#UseLogin no
#UsePrivilegeSeparation yes
#PermitUserEnvironment no
Compression yes
#ClientAliveInterval 0
#ClientAliveCountMax 3
#UseDNS yes
#PidFile /var/run/sshd.pid
#MaxStartups 10
PermitTunnel yes
# override default of no subsystems
Subsystem sftp /usr/sbin/sftp-server
Thanks in advance. Sorry for the mess.
.
- Follow-Ups:
- Re: OpenSSH: SSH2 sshd - Increase key size from 2048 to 8192 bits (Cygwin)
- From: Simon Tatham
- Re: OpenSSH: SSH2 sshd - Increase key size from 2048 to 8192 bits (Cygwin)
- Prev by Date: openssh: publickey authentication does not work, although key is found
- Next by Date: Re: openssh: publickey authentication does not work, although key is found
- Previous by thread: openssh: publickey authentication does not work, although key is found
- Next by thread: Re: OpenSSH: SSH2 sshd - Increase key size from 2048 to 8192 bits (Cygwin)
- Index(es):
Relevant Pages
|
|