Skip to Content

Disconnecting while logging into the remote server

When attempting to log in to a server from the backend, it encounters disconnection issues.

Follow the below steps to resolve the error

1.Tail the latest ezsh log of the user who attempted to log in to the server. Replace the username with the actual one.

root@admod:~# tail -f /home/username/ezsh.log


Tail the latest application and try to replicate the same error that get before. Replace the latest_log

root@admod:~# tail -f /var/www/ezlogin/application/logs/latest_log

The example mentioned below fixes the problem identified with the SSH logs.

2. If get these type of error in the log, then  follow the steps outlined below to resolve the issue.

root@admod:~# tail -f /home/linda/ezsh.log
New session started from to on Wed Feb 28 01:52:58 2024
Query failed (INSERT INTO `emhpp_sshlogs` (`user_id`, `server_id`, `serveractivity_id`, `ssh_user`, `type`, `status`, `file`, `encryption`, `mexecid`, `created`) VALUES ('49', '2728', '0', 'root', 'input', 'begin', '/var/log/ezlogin/input/linda/', '1', '', NOW())): Error 1062: Duplicate entry '1248166' for key 'PRIMARY'
SSH log entry (/var/log/ezlogin/input/linda/ creation failed: 0


     a) Identify the duplicate entry in the table mentioned in the ezsh.log and log into MySQL

Based on the information provided in the above screenshot, the duplicate entry identified by its primary key is 124866.

b) Add a new column named 'id' to the INSERT query and provide a value for the 'id' column by incrementing the duplicate entry mentioned in ezsh.log by one. Replace the values of ( `id`, `user_id`, `server_id`, `serveractivity_id`, `ssh_user`, `type`, `status`, `file`, `encryption`, `mexecid`, `created`) with the actual values.

mysql> INSERT INTO `emhpp_sshlogs` ( `id`, `user_id`, `server_id`, `serveractivity_id`, `ssh_user`, `type`, `status`, `file`, `encryption`, `mexecid`, `created`) VALUES ('1248167', '49', '2728', '0', 'root', 'input', 'begin', 'path_to_file', '1', '', NOW());

c) Delete the previously created entry from the table using a DELETE query. Replace "table_name" and "value" with the correct values. This will set the increment value correctly.

mysql> delete from table_name where id= value;

Example: mysql> delete from emhpp_sshlogs where id= 1248167;


3. Attempt to log in to the server that disconnected during the login attempt.

For a permanent solution, the best option would be to take a database dump and then re-import it, or alternatively, update the currently used Ezeelogin to the same version.


Related Articles 

Upgrade Ezeelogin Jump server to the latest version

Basic MySQL commands for troubleshooting database related issues in Ezeelogin