Skip to main content

Local PostgreSQL Database Setup for Rocky Linux 8.4-9.x and Red Hat 9.x

This section provides instructions to install local PostgreSQL database for primary Key Manager server running Rocky Linux 8.4 - 9.x or Red Hat 9.x.

First navigate to (replace /path/to/sshmgr7.0.0-*.x86_64 with the path to which the Key Manager installation package was extracted).

# cd /path/to/sshmgr7.0.0-*.x86_64

Install PostgreSQL on the machine. Also enable and start the PostgreSQL service.

Set up the contents of the database with following commands, where keymanager is your chosen name for the database user, and where keymanagerdb is your chosen name for the database:

# su - postgres
# createuser -S keymanager
# createdb keymanagerdb

Using psql as the postgres user, connect to the Key Manager database:

psql -d keymanagerdb

Then run these commands to set the database-user credentials and privileges:

  • For PostgreSQL 14:

    ALTER USER keymanager with encrypted password 'insert_chosen_password';
    GRANT ALL PRIVILEGES ON DATABASE keymanagerdb TO keymanager;
  • For PostgreSQL 15 or 16:

    ALTER USER keymanager with encrypted password 'insert_chosen_password';
    GRANT ALL PRIVILEGES ON SCHEMA PUBLIC TO keymanager;

Also configure the PostgreSQL to allow md5 connections to the database (the default is ident).

  • For PostgreSQL 14:

    Add the authentication to /var/lib/pgsql/14/data/pg_hba.conf, then restart PostgreSQL with:

    service postgresql-14 restart
  • For PostgreSQL 15 or 16:

    Add the authentication to /var/lib/pgsql/data/pg_hba.conf, then restart PostgreSQL with:

    service postgresql restart

You should now be able to complete the Key Manager setup by running ssh-mgr-setup.