This site best when viewed with a modern standards-compliant browser. We recommend Firefox Get Firefox!.

Linux-HA project logo
Providing Open Source High-Availability Software for Linux and other OSes since 1999.

USA Flag UK Flag

Japanese Flag

Домашняя Страница

О Нас


Правовая Информация

Как Помочь

Проблемы Безопасности

This web page is no longer maintained. Information presented here exists only to avoid breaking historical links.
The Project stays maintained, and lives on: see the Linux-HA Reference Documentation.
To get rid of this notice, you may want to browse the old wiki instead.

How to generate authkeys automatically

Since the key in /etc/ha.d/authkeys file never has to be typed by a human being, it is not necessary for it to be in any way mnemonic or memorable. As a result a long, randomly generated key is a good choice.

The following line of shell script will generate such a key:

cat <<-!AUTH >/etc/ha.d/authkeys
        # Automatically generated authkeys file
        auth 1
        1 sha1 `dd if=/dev/urandom count=4 2>/dev/null | md5sum | cut -c1-32`

Or you can download a complete command which will do this quite nicely.

Or for SHA1:

dd if=/dev/urandom count=4 2>/dev/null | openssl dgst -sha1