A public key is always created for SSH Tectia Server during the installation phase. In addition, the Server administrator can generate more public-key pairs for the host, according to need.
The server is authenticated with a digital signature based on a DSA or RSA public-key algorithm. At the beginning of each connection, the server sends its public key to the client for validation.
The key pair that the server uses in server authentication is defined
in the server configuration file, ssh-server-config.xml
, with the
following elements:
<params> <hostkey> <private file="/etc/ssh2/hostkey" /> <public file="/etc/ssh2/hostkey.pub" /> </hostkey> ... </params>
Giving the public key in the configuration file is not mandatory. It will be derived from the private key if it is not found otherwise. Specifying the public key will, however, decrease start-up time for the software, as deriving the public key is a somewhat time-consuming operation.
During the installation process, one RSA key pair (with the file
names hostkey
and hostkey.pub
) is generated
and stored in the /etc/ssh2
directory on Unix and in the
"C:\Program Files\SSH Communications Security\SSH Tectia\SSH Tectia Server
" directory on Windows. By default, this
key pair is used for server authentication.
Each SSH Tectia Server can have multiple host keys. You could have, for example, the
following set of parameters in your ssh-server-config.xml
file:
<params> <hostkey> <private file="/etc/ssh2/hostkey_dsa" /> <public file="/etc/ssh2/hostkey_dsa.pub" /> </hostkey> <hostkey> <private file="/etc/ssh2/hostkey_rsa" /> <public file="/etc/ssh2/hostkey_rsa.pub" /> </hostkey> ... </params>
Both keys are stored in memory when the ssh-server-g3
process is started, which means that either one of them can be used to
authenticate the server.
We recommend that you use a maximum of one DSA and one RSA key pair. If also certificates are used in server authentication, an additional two host key pairs (DSA with certificate and RSA with certificate) can be used for a total of four host keys.
On Windows, the host keys can be configured with the SSH Tectia Server Configuration tool on the Identity page. See Identity.
A host public-key pair (1536-bit RSA) is always generated during the installation of SSH Tectia Server. You only need to regenerate it if you want to change your host key pair.
The command-line tool ssh-keygen-g3
can be
used to generate the host key pair. It can be used for creating
the user key pairs as well.
On Unix, to (re)generate the host key, give the following command with root privileges:
# ssh-keygen-g3 -P -H hostkey
where:
-P
indicates that the key has an empty passphrase
-H
indicates that the key pair is stored in the default
host key directory
On Windows, to (re)generate the host key, give the following command:
ssh-keygen-g3.exe -P -H hostkey
This will generate a 2048-bit DSA key pair (without a passphrase)
and save it in the default host key directory (/etc/ssh2
on
Unix, "C:\Program Files\SSH Communications Security\SSH Tectia\SSH Tectia Server
" on Windows) with the names
hostkey
and hostkey.pub
. For more information
on the key generation options, see ssh-keygen-g3(1).
After the new key pair has been created, run
ssh-server-config-tool
to reconfigure the server.
See ssh-server-config-tool(8).
Note | |
---|---|
The private key of the server must
never be readable by anyone but |
Administrators that have other users connecting to their server should notify the users of any host key changes. The users will receive a warning the next time they connect because the host key the users have saved on their disk for your server does not match the host key now being actually provided by your server. The users may not know how to respond to this warning. SSH Tectia Manager (available separately) provides an automatic mechanism for distributing the host keys.
You can run ssh-keygen-g3
to calculate the fingerprint of
your new public host key and you can provide the fingerprint to your users via some
unalterable method (for example, by a digitally signed e-mail or by
displaying the fingerprint on a secured bulletin board).
On Unix, the command for calculating the fingerprint is:
# ssh-keygen-g3 -F hostkey.pub
On Windows, the command is:
ssh-keygen-g3.exe -F hostkey.pub
When the users connect and receive the error message about the host key having changed, they can compare the fingerprint of the new key with the fingerprint you have provided in your e-mail, and ensure that they are connecting to the correct SSH Tectia Server. Inform your users to notify you if the fingerprints do not match, or if they receive a message about a host key change and do not receive a corresponding message from you notifying them of the change.
This procedure can help ensure that you do not become a victim of a man-in-the-middle attack, as your users will notify you if the host key fingerprints do not match.
It is also possible to send the public host key to the users via
an unalterable method. The users can save the key in the
$HOME/.ssh2/hostkeys
directory on Unix or in the
%APPDATA%\SSH\HostKeys
directory on Windows as key_<port>_<host>.pub
(for example, key_22_banana.ssh.com.pub
). In this case,
a manual fingerprint check is not needed. SSH Tectia Manager can distribute the host
keys automatically.