Improving Client Usability
This section provides some tips about how to improve the usability of the Key Manager clients.
Improving Command-Line Client Usability
In the previous sections you have set up a fully functioning command-line client. You can now log in as the client user and run a few commands to test that everything works. For example, listing hosts using the command-line client (replace frontend.example.com with the address of your Key Manager front end):
$ /opt/sshmgr/bin/ssh-mgr-client -U https://frontend.example.com/api/v2 list-hosts
To prevent having to type the API URL with every command, set the API URL in the SSHMGR_URL environment variable. If the SSHMGR_URL environment variable is set, the command-line client automatically connects to the address specified in that environment variable.
The Key Manager API runs on all Key Manager front ends. For example, if you have a Key Manager front end at the address example.frontend.com, you should set SSHMGR_URL to https://example.frontend.com/api/v2/
$ export SSHMGR_URL=https://frontend.example.com/api/v2/
So instead of having to type:
$ /opt/sshmgr/bin/ssh-mgr-client -U https://frontend.example.com/api/v2/ list-hosts
You can now type:
$ /opt/sshmgr/bin/ssh-mgr-client list-hosts
You can further simplify the command by defining aliases, or by adding the command-line client to a location on your executable path. For example:
# ln -s /opt/sshmgr/bin/ssh-mgr-client /usr/local/bin/ssh-mgr-client
Now, the command has been simplified to:
$ ssh-mgr-client list-hosts
Improving API Client Usability
You can simplify commands by defining aliases, or by adding the API client to a location on your executable path. For example:
# ln -s /opt/sshmgr/bin/ssh-mgr-cli /usr/local/bin/ssh-mgr-cli
Now, instead of having to type:
$ /opt/sshmgr/bin/ssh-mgr-cli client login
You can instead type:
$ ssh-mgr-cli client login