Skip to Content

Add server with private key stored in database with API

How to add a server with the private key stored in the database using API?

1. Login to Ezeelogin GUI -> Key Management -> Add new private key and passphrase. Refer to below screenshot.

2. Login to the gateway server and add the server with API using the key stored in the database. Provide the key name stored in GUI followed by -db_ssh_key

Refer detailed article for add/update/delete server using API.

root@gateway ~]# php /usr/local/ezlogin/ezwapi.php add_server -api_url http://192.168.1.9/ezlogin -secret zxcvbnm -name ubuntu.noc.com -description ubuntu.server -ssh_user root -password test123 -ip_address 10.11.1.138 -group production.server -enable_ssh Y -keep_password S -db_ssh_key ubuntu_private_key

3. Login to Ezeelogin GUI and click on the view icon to see the name of the private key. Refer to below screenshot.

How to update a server with the private key stored in the database using API?

1.  Login to Ezeelogin GUI -> Key Management -> Add new private key and passphrase. Refer to below screenshot.

2. Login to the gateway server and update the server with API using the key stored in the database. Provide the key name stored in GUI followed by -db_ssh_key

root@gateway ~]# php /usr/local/ezlogin/ezwapi.php update_server -api_url http://192.168.1.9/ezlogin -secret zxcvbnm -name ubuntu.noc.com -description centos.server -password test123 -ip_address 10.11.1.140 -group production_server -ssh_port 22 -rdp_port 3389 -newname centos.noc.com -db_ssh_key centos_private_key

3. Login to Ezeelogin GUI and click on the view icon to see the updated server with the private key. Refer below screenshot.

 

Related Articles