OpenSSH: SSH2 sshd - Increase key size from 2048 to 8192 bits (Cygwin)



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.

.



Relevant Pages

  • Re: WCF security advice (and clarification) needed
    ... You, the client, resolve the foo.mycompany.com hostname within your ... TCP/IP) with that ticket as the security token. ... There are two parties participating in a security scenario, the server ... HTTP supports other authentication ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: Aironet 1200/Radius Help Needed
    ... I just fired up a W2003 Advanced Server so that I can take ... >> IAS servers (do I need a separate certificate for the secondary IAS ... >> of authentication since it involves just installing the certificate on ... >between the AP and the client. ...
    (microsoft.public.internet.radius)
  • Re: client -server interaction over XML supporting multiple protocols
    ... > NETBEUI to access the server to access the functionalities exposed. ... > server doesnot know in advance which client is using what protocol. ... size of the XML and Xfunctionality will determine the demands ...
    (comp.lang.cpp)
  • Re: Windows Authentication, Single sign on and Active Directory
    ... service proxy client fails to connect due to authentication failure and then ... Co-author of "The .NET Developer's Guide to Directory Services Programming" ... The server is always in the domain. ...
    (microsoft.public.dotnet.framework.aspnet.security)
  • Re: Outlook -> remote exchange -> always wants a password
    ... I have my server set to use Integrated Windows authentication over SSL. ... almost certainly "break" your existing users if the client setup does not ... Close out of these configuration dialogs, ...
    (microsoft.public.windows.server.sbs)