Skip to Content

Change the authentication method to use only password in Ezeelogin

How do I change the authentication method to use only password to remote servers added in Ezeelogin?

The following steps will clear the global key saved on the remote server and all private keys stored in Ezeelogin.

After completing all these steps and attempting to log in to the remote server, the authentication method used will be password-based.

Replace the private key ID with zero to unassign the saved private key for a server or server group.

It is recommended to use key-based authentication for remote servers accessed through Ezeelogin.

If both password and key are saved for authenticating to remote servers from Ezeelogin, the key will be used by default since it offers better security.

The priority of authentication methods used in Ezeelogin is as follows:

1. Key saved while adding the server (SSH Private Key).
2. Saved private key stored in key management.
3. Global key (Ezeelogin key).
4. Password-based authentication, which is the least preferred method.

How to clear Ezeelogin public key (Global Key) from remote servers?

  • How to clear Ezeelogin public key (Global Key) for a single remote server?

Login to the remote server and run the below command to remove only the global key.

user@remote_server ~]# sed -i '/\bezlogin\b/d' ./.ssh/authorized_keys

  • How to clear Ezeelogin public key (Global Key) for a server group?

Login to the ezsh shell and run the below command in the parallel shell to remove the added global key of Ezeelogin in all servers from the selected server group.

[group:production server]# sed -i '/\bezlogin\b/d' ./.ssh/authorized_keys

  • How to clear Ezeelogin public key (Global Key) from all remote servers?

Login to the ezsh shell and run the below command in the parallel shell to remove the added global key of Ezeelogin in all servers.

[group:ALL server]# sed -i '/\bezlogin\b/d' ./.ssh/authorized_keys

How to clear the private key added to the remote server?

  • How to clear the private key added to a single server?

Login to the gateway server and run the below command to clear the saved private key. Replace the server name from the below command.

root@gateway ~]# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_servers set ssh_key=NULL,passphrase=NULL where name='server_name'"

  • How to clear the private key saved for all servers in a server group?

1. Find out the database name and table prefix using the below command. Specify the super admin password when prompted for the password.

root@gateway ~]# php /usr/local/ezlogin/eztool.php -- -show_db_credentials

Database: ezlogin_qjh
Table Prefix: ljww_

2. Run the below command and replace the database name and table prefix to find the server group ID.

root@gateway ~]# mysql -u root -p -e "use database_name; select id,name from tableprefix_servergroups;"

+----+-------------------+
| id | name              |
+----+-------------------+
| 1 | production_server  |
| 2 | development_server |
+----+-------------------+

3. Run the below command to clear the saved private key for all servers in a server group. Replace the server group ID from the below command.

root@gateway ~]# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_servers set ssh_key=NULL,passphrase=NULL where servergroup_id=2"

  • How to clear the private key saved for all servers?

Login to the gateway server and run the below command to clear the saved private key for all servers.

root@gateway ~]# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_servers set ssh_key=NULL,passphrase=NULL"

How to clear the saved private key added to the remote server?

  • How to clear the saved private key from a single server?

Login to the gateway server and run the below command to unassign the saved private key. Replace the server name from the below command.

root@gateway ~]# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_servers set ssh_private_key_id='0' where name='server_name'"

  • How to clear the saved private key from a server group?

1. Find out the database name and table prefix using the below command. Specify the super admin password when prompted for the password.

root@gateway ~]# php /usr/local/ezlogin/eztool.php -- -show_db_credentials

Database: ezlogin_qjh
Table Prefix: ljww_

2. Run the below command and replace the database name and table prefix to find the server group ID.

root@gateway ~]# mysql -u root -p -e "use database_name; select id,name from tableprefix_servergroups;"

+----+-------------------+
| id | name              |
+----+-------------------+
| 1 | production_server  |
| 2 | development_server |
+----+-------------------+

3. Replace the ID in the following command with your server group ID and private key ID to apply the changes to the specific server group in Ezeelogin.

root@gateway ~]# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_servers set ssh_private_key_id='0' where servergroup_id='2'"

  • How to clear the saved private key from a server group?

Login to the gateway server and run the below command to unassign the saved private key for all servers.

root@gateway ~]# php /usr/local/ezlogin/ez_queryrunner.php "update prefix_servers set ssh_private_key_id='0'"