Extract Ezeelogin backup file
How to extract the Ezeelogin backup file and use it without restoring?
1. 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
2. Create a directory and extract the latest backup file. Run the below commands.
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.
- How to restore the database from the Ezeelogin backup file?
1. Login to MySQL database and create a new database to restore the backup database.
root@gateway ~]# mysql -u root -p
mysql> create database restore_db;
2. Restore the backup database to the newly created database.
root@gateway ~]# mysql -u root -p restore_db < ./backup_extract/database.sql
- How to retain the SSH log from the Ezeelogin backup file?
Run the below command to view all logs.
root@gateway ~]# ls ./backup_extract/logs/
Refer below example to view the SSH log from the terminal.
In the below example, ezadmin user logged into the ubuntu server and executed the date command.
Refer below article to view the encrypted SSH logs.
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
- How to restore the standalone file from the Ezeelogin backup file?
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 Ezlogin, refer below steps.
1. Backup the current standalone file by running the below command.
root@gateway ~]# cp -pr /usr/local/etc/ezlogin/lic.dat lic_2023_backup.dat
2. Replace the old standalone file by running the below command.
root@gateway ~]# cp lic_backup.dat /usr/local/etc/ezlogin/lic.dat
- How to restore the key, license, and configurations from the Ezeelogin backup file?
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
- How to restore the eztool from the Ezeelogin backup file?
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
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.