Extract Ezeelogin backup file
How to extract the Ezeelogin backup file and use it without restoring?
Overview: This article helps to extract and utilize the Ezeelogin backup file without restoring it. It covers database restoration, retaining SSH logs, retrieving standalone files, and restoring keys, licenses, configurations, and eztool from the backup file.
1. List and extract backup file
Step 1(A): Run the below command to list all backup files in /var.
root@gateway ~]# ls /var/ezlogin_*
/var/ezlogin_backup_v7.30.0_b381_p7.2.34-38+ubuntu20.04.1+deb.sury.org+1_Wed_Mar_01_2023_12_53_25_UTC.bin
Step 1(B): Create a directory and extract the latest backup file.
root@gateway ~]# mkdir ./backup_extract
root@gateway ~]# sh /var/ezlogin_backup_****.bin --noexec --target ./backup_extract/
All the required files will be available in the directory created.
2. How to restore the database from the Ezeelogin backup file?
Step 2(A): Login to MySQL and create a new database to restore the backup database.
root@gateway ~]# mysql -u root -p
mysql> create database restore_db;
Step 2(B): Restore the backup database to the newly created database.
root@gateway ~]# mysql -u root -p restore_db < ./backup_extract/database.sql
3. How to retain the SSH log from the Ezeelogin backup file?
Step 3(A): Run the below command to view all logs.
root@gateway ~]# ls ./backup_extract/logs/
Refer below example to view the SSH log .
root@gateway ~]# cat ./backup_extract/logs/full/ezadmin/root~ubuntu~Wed_Mar_1_13\:24\:35_2023
Last login: Wed Mar 1 13:24:31 2023 from 192.168.1.7
root@ubuntu:~# date
Wed Mar 1 13:24:36 UTC 2023
root@ubuntu:~#
logout
In the above example, ezadmin user logged into the ubuntu server and executed the date command.
Refer below article to view the encrypted SSH logs.
4. How to restore the standalone file from the Ezeelogin backup file?
Step 4(A): Run the below command to copy the standalone file to the root directory.
root@gateway ~]# cp ./backup_extract/etc/lic.dat lic_backup.dat
If you want to use the backup standalone file in the current running Ezeelogin, refer below steps.
1. Backup the current standalone file.
root@gateway ~]# cp -pr /usr/local/etc/ezlogin/lic.dat lic_2023_backup.dat
2. Replace the old standalone file.
root@gateway ~]# cp lic_backup.dat /usr/local/etc/ezlogin/lic.dat
5. How to restore the key, license, and configurations from the Ezeelogin backup file?
Step 5(A): Run the below command to list all the keys, licenses, and configuration files.
root@gateway ~]# ll backup_extract/etc/
build.dat
cacert.pem
ez.conf
id_clkey
id_clkey.pub
id_key
id_key.pub
lic.dat
replication.conf
6. How to restore the eztool from the Ezeelogin backup file?
Step 6(A): Run the below command to create the eztool in the home directory of the root user.
root@gateway ~]# cp backup_extract/setup/setup.php ./eztool.php
Step 6(B): Run the below command to display the help menu of eztool.
root@gateway ~]# php eztool.php -help
-help : Show this help
-version : Show the version
-fix_log_permissions : Fix the ownership and permissions of audit log files and folders.
-reimport_logs : Import metadata of logs in filesystem to database. (slave migration)
-show_db_credentials : Show the database connection credentials.
-user_report [<username(s)>] : Generate a report of users' access to servers.
-out <csv_file_path> : Specify the path to the CSV file output (only for -user_report).
-install_node_modules : Install the NodeJS modules required for Web SSH, Web RDP and Web Proxy.
-no_exec : Sub-option for -install_node_modules. Only show the commands. Do not execute them.
-node_component : Sub-option for -install_node_modules. Values: webssh, webrdp or ezproxy.
Related Articles:
Backup Ezeelogin failed during Ezeelogin version upgrade
How do I create a complete backup of my Ezeelogin installation?
Backup/restore crashes abruptly without any error