Skip to main content

External-Host Commands

External-host commands are used for managing the external hosts recognized by Key Manager.

For more information about external hosts, see Managing External Hosts.

count-external-hosts

Syntax:

ssh-mgr-client count-external-hosts [options] [-F <filter>] [-vvv] [-U <url>]

Returns the number of external hosts (known hosts outside the managed environment).

Typically, external hosts are hosts that have not been added to the managed environment but have publickey access to the hosts within the managed environment.

When filters are specified, this command returns the number of external hosts that match the filter criteria. For filtering, you can use the same attributes that are available for the list-external-hosts command (see list-external-hosts).

Example:

$ ssh-mgr-client count-external-hosts
20

Example for displaying the number of those external hosts, the IP of which starts with 10:

$ ssh-mgr-client count-external-hosts -F "ip=10*"
18

create-external-host

Syntax:

ssh-mgr-client create-external-host -d <data> [options] [-vvv] [-U <url>]

Adds information about an external host to Key Manager.

Required data:

hostname

The name of the host.

ip

The IP address of the host

Optional data:

classification

Free-text classification for this host.

data

Data for the host in JSON format.

Example:

$ ssh-mgr-client create-external-host -d \
ip="192.0.2.100",classification="EXT",hostname="server.example.com"

list-external-hosts

Syntax:

ssh-mgr-client list-external-hosts [options] [-F <filter>] [-vvv] [-U <url>] \
[-o <format>] [-C <columns>] [-H] [-O <sort-order>] [-S <start-from>] \
[-M <max-results>] [-E <delim>] [-B]

The default command lists all the external hosts. By default, the columns hostname, classification, and id are displayed:

$ ssh-mgr-client list-external-hosts

server01.example.com,PROD,1
server02.example.com,PROD,2
192.0.2.100,TEST,3
...

The following columns can be used for filtering (-F) and output formatting (-C):

classification

Classification of the external host

hostname

Hostname of the external host

id

Internal PrivX Key Manager id for external host

ip

IP address(es) of the external host. Only usable for output formatting (-C).

For example, to display the hostname and IP address of all the hosts with a certain classification:

$ ssh-mgr-client list-external-hosts -F "classification=CLASS" -C "hostname,ip"

show-external-host

Syntax:

ssh-mgr-client show-external-host -i <id> [options] \
[-vvv] [-U <url>] [-o <format>] [-C <columns>]

Displays the external host with the given ID. For output formatting, you can use similar attributes as the list-external-hosts command (see list-external-hosts).

Example:

$ ssh-mgr-client show-external-host -i 3

delete-external-host

Syntax:

ssh-mgr-client [options] delete-external-host -i <id>

Delete an external host from the Key Manager database.

Identify the external host by providing its ID (-i).

Example:

$ ssh-mgr-client delete-external-host -i 2