GET SSH Users

The GET /SSHClosed The SSH (secure shell) protocol provides for secure connections between computers. It provides several options for authentication, including public key, and protects the communications with strong encryption./Users operation retrieves one or more SSH users defined in Keyfactor Command. The operation returns both users and service accounts. See SSH for more information on the difference between users and service accounts. Query parameters support filtering using defined criteria, control over pagination by specifying the page number and return limit, and customization of sorting based on specified fields and order. On success, the operation returns HTTP 200 OK with  details for the requested SSH users and their public keys. To return the SSH private keyClosed Private keys are used in cryptography (symmetric and asymmetric) to encrypt or sign content. In asymmetric cryptography, they are used together in a key pair with a public key. The private or secret key is retained by the key's creator, making it highly secure., use the GET SSH Keys My Key operation for user accounts and the GET SSH Service Accounts Key ID operation for service accounts.

Tip:  The following permissions (see Security Roles and Claims) are required to use this feature:
/ssh/server_admin/
OR
/ssh/enterprise_admin/

SSH actions are affected by ownership on the server group with which user to logon mappings are associated and limited for users with only the Server Admin (/ssh/server_admin/) role. For more information, see SSH Permissions.

This operation has two available versions. Keyfactor recommends using the newer operation when possible. For more information, see Endpoint Definition Versioning.

Version 2 of GET /SSH/Users redesigns how logon information for the user is returned, providing a greater level of detail in the returned data.

Table 931: GET SSH Users v2 Input Parameters

Name In Description
showOwnedAccess Query

A Boolean that specifies whether to return only users that have logons on servers that the requesting user owns (True or False). The default is False.

This option applies only to requesting users with SSH User or SSH Server Admin permissions. Users with SSH Enterprise Admin permissions will see all users regardless of the configuration of this setting.

Use the GET SSH Servers or GET SSH Server Groups operation to determine ownership of a server or server group.

Example:  Example Scenario One
  • Server A is owned by Gina and server B is owned by John.

  • Gina is an SSH Server Admin but not an SSH Enterprise Admin.

  • Dave has a logon on server B but not on server A.

Gina does a GET /SSH/Users with showOwnedAccess=false and looks at the results for Dave's user record. She sees Dave's user record, but sees no specific logon information for Dave (other than the LogonCount), because all Dave's logons are on servers that Gina does not own.

Gina does a GET /SSH/Users with showOwnedAccess=true and looks at the results for Dave's user record. Dave's user record does not appear.

The presence or absence of Dave's user record is controlled by showOwnedAccess. The presence or absence of logon information associated with Dave's user record is controlled by Gina's level of SSH permissions—with SSH Server Admin permissions, Gina will always see only logons for servers that she owns.

Example:  Example Scenario Two
  • Server A is owned by Gina and server B is owned by John.

  • Gina is an SSH Server Admin but not an SSH Enterprise Admin.

  • Dave has a logon on server B and a logon on server A.

Gina does a GET /SSH/Users with showOwnedAccess=false and looks at the results for Dave's user record. She sees Dave's user record and she sees logon information for server A, but no logon information for server B. Because Gina does not own server B, logon information for that server is not visible to her.

Gina does a GET /SSH/Users with showOwnedAccess=true and looks at the results for Dave's user record. She sees Dave's user record and she sees logon information for server A, but no logon information for server B. Because Gina does not own server B, logon information for that server is not visible to her.

Notice there is no difference here in the results whether you choose True or False because at least one logon for Dave is present on a server owned by Gina. The showOwnedAccess option only comes into play when a user has no logons on a server owned by the requesting user.

The presence or absence of logon information associated with Dave's user record is controlled by Gina's level of SSH permissions—with SSH Server Admin permissions, Gina will always see only logons for servers that she owns.

QueryString Query

A string containing a query to limit the results (for example, field1 -eq value1 AND field2 -gt value2). The default is to return all records. Fields available for querying through the API for the most part match those that appear in the Keyfactor Command Management Portal search dropdowns for the same feature. For querying guidelines, refer to: Searching SSH Users. The query fields supported for this operation are:

  • Email
  • Fingerprint
  • IsServiceAccount
  • KeyLength
  • KeyType
  • LogonCount
  • LogonServerGroupId
  • LogonServerId
  • ServiceAccountId
  • StaleDate
  • Username
PageReturned Query An integer that specifies how many multiples of the returnLimit to skip and offset by before returning results, to enable paging. The default is 1.
ReturnLimit Query An integer that specifies how many results to return per page. The default is 50. Very large values can result in long processing time.
SortField Query A string containing the property by which the results should be sorted. Fields available for sorting through the API for the most part match those that appear as sortable columns in the Keyfactor Command Management Portal. The default sort field is Username.
SortAscending Query An integer that sets the sort order on the returned results. A value of 0 sorts results in ascending order while a value of 1 sorts results in descending order. The default is ascending.

Table 932: GET SSH Users v2 Response Data

Name

Description

Id

An integer indicating the Keyfactor Command reference ID of the SSH user.

Key

An object containing information about the key for the user. ClosedShow key details.

Username A string indicating the full username of the user or service account. For a user account, the username appears in DOMAIN\\username format (for example, KEYEXAMPLE\\jsmith). For a service account, the username is made up of the user name and ClientHostname entered when the service account is created (for example, myapp@appsrvr75).
Access

An object containing information about the Linux logons mapped to the user. ClosedShow Linux logon mapping details.

IsGroup A Boolean indicating whether the user is an Active Directory group (True or False).

Version 1 of GET /SSH/Users includes the same capabilities as version 2, but offers more limited information on returned logons for the user.

Table 933: GET SSH Users v1 Input Parameters

Name In Description
showOwnedAccess Query

A Boolean that specifies whether to return only users that have logons on servers that the requesting user owns (True or False). The default is False.

This option applies only to requesting users with SSH User or SSH Server Admin permissions. Users with SSH Enterprise Admin permissions will see all users regardless of the configuration of this setting.

Use the GET SSH Servers or GET SSH Server Groups operation to determine ownership of a server or server group.

Example:  Example Scenario One
  • Server A is owned by Gina and server B is owned by John.

  • Gina is an SSH Server Admin but not an SSH Enterprise Admin.

  • Dave has a logon on server B but not on server A.

Gina does a GET /SSH/Users with showOwnedAccess=false and looks at the results for Dave's user record. She sees Dave's user record, but sees no specific logon information for Dave (other than the LogonCount), because all Dave's logons are on servers that Gina does not own.

Gina does a GET /SSH/Users with showOwnedAccess=true and looks at the results for Dave's user record. Dave's user record does not appear.

The presence or absence of Dave's user record is controlled by showOwnedAccess. The presence or absence of logon information associated with Dave's user record is controlled by Gina's level of SSH permissions—with SSH Server Admin permissions, Gina will always see only logons for servers that she owns.

Example:  Example Scenario Two
  • Server A is owned by Gina and server B is owned by John.

  • Gina is an SSH Server Admin but not an SSH Enterprise Admin.

  • Dave has a logon on server B and a logon on server A.

Gina does a GET /SSH/Users with showOwnedAccess=false and looks at the results for Dave's user record. She sees Dave's user record and she sees logon information for server A, but no logon information for server B. Because Gina does not own server B, logon information for that server is not visible to her.

Gina does a GET /SSH/Users with showOwnedAccess=true and looks at the results for Dave's user record. She sees Dave's user record and she sees logon information for server A, but no logon information for server B. Because Gina does not own server B, logon information for that server is not visible to her.

Notice there is no difference here in the results whether you choose True or False because at least one logon for Dave is present on a server owned by Gina. The showOwnedAccess option only comes into play when a user has no logons on a server owned by the requesting user.

The presence or absence of logon information associated with Dave's user record is controlled by Gina's level of SSH permissions—with SSH Server Admin permissions, Gina will always see only logons for servers that she owns.

QueryString Query

A string containing a query to limit the results (for example, field1 -eq value1 AND field2 -gt value2). The default is to return all records. Fields available for querying through the API for the most part match those that appear in the Keyfactor Command Management Portal search dropdowns for the same feature. For querying guidelines, refer to: Searching SSH Servers. The query fields supported for this operation are:

  • Email
  • Fingerprint
  • IsServiceAccount
  • KeyLength
  • KeyType
  • LogonCount
  • LogonServerGroupId
  • LogonServerId
  • ServiceAccountId
  • StaleDate
  • Username
PageReturned Query An integer that specifies how many multiples of the returnLimit to skip and offset by before returning results, to enable paging. The default is 1.
ReturnLimit Query An integer that specifies how many results to return per page. The default is 50. Very large values can result in long processing time.
SortField Query A string containing the property by which the results should be sorted. Fields available for sorting through the API for the most part match those that appear as sortable columns in the Keyfactor Command Management Portal. The default sort field is Username.
SortAscending Query An integer that sets the sort order on the returned results. A value of 0 sorts results in ascending order while a value of 1 sorts results in descending order. The default is ascending.

Table 934: GET SSH Users v1 Response Data

Name

Description

Id

An integer indicating the Keyfactor Command reference ID of the SSH user.

Key

An object containing information about the key for the user. ClosedShow key details.

Username A string indicating the full username of the user or service account. For a user account, the username appears in DOMAIN\\username format (for example, KEYEXAMPLE\\jsmith). For a service account, the username is made up of the user name and ClientHostname entered when the service account is created (for example, myapp@appsrvr75).
LogonIds

An array of integers indicating the Keyfactor Command reference IDs for the Linux logons mapped to the user to cause the user's SSH public key to be published out to the Linux servers on which those logons reside.