Add a public SSH key

This method adds an authorized public SSH key for a specific user in the Vault, allowing them to authenticate to the Vault through PSM for SSH using a corresponding private SSH key.

The user who runs this web service requires Reset Users' Passwords permissions in the Vault.

In addition, the user who runs this web service must be in the same Vault location as or higher than the user whose public SSH keys are added.

 

A user cannot manage their own public SSH keys.

URL

 

Make sure there are no spaces in the URL.

The following characters are not supported in URL values: + & %

 

 

https://<IIS_Server_Ip>/PasswordVault/WebServices/PIMServices.svc/Users/{UserName}/AuthenticationMethods/SSHKeyAuthentication/AuthorizedKeys

The following mandatory value is required in the URL:

Parameter

UserName

Type

String

Description

The name of the user whose public SSH keys will be added.

 
  • This username is not case-sensitive.
  • Specify the name of any user in the Vault.

Valid values

Vault user name

Resource information

HTTP method

POST

Content type

application/json

Header parameter

Parameter

Authorization

Type

String

Description

The token that identifies the session.

Valid values

A session token that was returned from the “Logon” method.

Body parameters

 

The public SSH key must be included as a JSON object in the request body.

 

 
{

"PublicSSHKey":"<public-key>"

}

 

Parameter

PublicSSHKey

Type

String

Description

The content of the public SSH key as it appears in the authorized_keys file. This parameter is required.

Mandatory

Yes

Valid values

A public SSH key.

  • This key must not include new lines ('\n').
  • Do not include options such as "command", as they are not supported when authenticating through PSM for SSH.
  • This key can only include comments in English.

Result

 
{


"AddUserAuthorizedKeyResult":

{

"KeyID":"<key-id>",

"PublicSSHKey":"<public-key>"

}

}

Return codes

For a complete list of return codes, see Return Codes.