mkdir -p /opt/backup/database chown -Rf postgres:postgres /opt/backup chmod 700 /opt/backup/database # deploy the script above: vim /opt/backup/enc_backup_database.sh chown root:postgres /opt/backup/enc_backup_database.sh chmod 750 /opt/backup/enc_backup_database.sh # create public-private keypair on YOUR machine, NOT on the CzechIdM server # copy ONLY the public key to the CzechIdM server, STORE the private key SAFELY scp publickey.key czechidm-server:/opt/backup/backup_database-rsa.pub chown root:postgres /opt/backup/backup_database-rsa.pub chmod 440 /opt/backup/backup_database-rsa.pub