SSH Key Configuration
The following API commands enable you to configure SSH Keys:
These commands require Control-M/EM 9.0.21.200 or higher.
config server:sshkey::add
The config server:sshkey::add command enables you to add an SSH key to the Control-M/Server.
CLI Syntax
ctm config server:sshkey::add <server> <keyName> <passphrase> [format] [type] [bits] [-f sshKeyData.json] -p
                                                    The following table describes the config server:sshkey::add command parameters.
| 
                                                                 Parameter  | 
                                                            
                                                                 Description  | 
                                                        
|---|---|
| 
                                                                 server  | 
                                                            
                                                                 Defines the Control-M/Server name.  | 
                                                        
| 
                                                                 keyName  | 
                                                            
                                                                 Defines the key name. Valid Values: 1–256 alphanumeric characters and _ (underscores).  | 
                                                        
| 
                                                                 passphrase  | 
                                                            
                                                                 Defines the key file password, which is encrypted with RunAsUserEncryptionHelper.  | 
                                                        
| 
                                                                 format  | 
                                                            
                                                                 (Optional) Determines which format to generate the SSH key in, as follows: 
  | 
                                                        
| 
                                                                 type  | 
                                                            
                                                                 (Optional) Determines which type of SSH key to generate, as follows: 
  | 
                                                        
| 
                                                                 bits  | 
                                                            
                                                                 (Optional) Determines the number of bits to generate the key in, as follows: 
 Larger values provide greater security.  | 
                                                        
| 
                                                                 sshKeyData.json  | 
                                                            
                                                                 (Optional) Defines the pathname to a JSON file that contains the following parameters, which eliminates the need to include them in the CLI: 
 This eliminates the need to include Copy
                                                                         
                                                                
                                                                         | 
                                                        
| 
                                                                 -p  | 
                                                            
                                                                 (Optional) Adds a password confirmation prompt.  | 
                                                        
REST API Syntax
cURL:
server=IN01
curl -H "x-api-key: $token" -H "Content-Type: application/json" -X POST
"%endpoint%/config/server/$server/sshkey/add"
                                                        config server:sshkey::update
The config server:sshkey::update command enables you to update an SSH key on the Control-M/Server.
CLI Syntax
ctm config server:sshkey::update <server> <keyName> <passphrase> [-f sshKeyData.json]
                                                    The following table describes the config server:sshkey::update command parameters.
| 
                                                                 Parameter  | 
                                                            
                                                                 Description  | 
                                                        
|---|---|
| 
                                                                 server  | 
                                                            
                                                                 Defines the Control-M/Server name.  | 
                                                        
| 
                                                                 keyName  | 
                                                            
                                                                 Defines the key name. Valid Values: 1–256 alphanumeric characters and _ (underscores).  | 
                                                        
| 
                                                                 passphrase  | 
                                                            
                                                                 Defines the key file password, which is encrypted with RunAsUserEncryptionHelper.  | 
                                                        
| 
                                                                 sshKeyData.json  | 
                                                            
                                                                 (Optional) Defines the pathname to a JSON file that contains the following parameters, which eliminates the need to include them in the CLI: 
 Copy
                                                                         
                                                                
                                                                         | 
                                                        
REST API Syntax
cURL:
server=IN01
curl -H "x-api-key: $token" -H "Content-Type: application/json" -X POST
"%endpoint%/config/server/$server/sshkey/update"
                                                        config server:sshkey::deleteSshKey
The config server:sshkey::deleteSshKey command enables you to delete an SSH key from the Control-M/Server.
CLI Syntax
ctm config server:sshkey::deleteSshKey <server> <keyName> <passphrase> [-f <configuration file>]
                                                    The following table describes the config server:sshkey::deleteSshKey command parameters.
| 
                                                                 Parameter  | 
                                                            
                                                                 Description  | 
                                                        
|---|---|
| 
                                                                 server  | 
                                                            
                                                                 Defines the Control-M/Server name.  | 
                                                        
| 
                                                                 keyName  | 
                                                            
                                                                 Defines the key name. Valid Values: 1–256 alphanumeric characters and _ (underscores).  | 
                                                        
| 
                                                                 passphrase  | 
                                                            
                                                                 Defines the key file password, which is encrypted with RunAsUserEncryptionHelper.  | 
                                                        
| 
                                                                 configuration file  | 
                                                            
                                                                 (Optional) Defines the pathname to a JSON file that contains the required keyName and passphrase, which eliminates the need to include them in the API command.  | 
                                                        
REST API Syntax
cURL:
server=IN01
curl -H "x-api-key: $token" -H "Content-Type: application/json" -X POST
"%endpoint%/config/server/$server/sshkey/deleteSshKey"
-d '{"keyName": "$keyName","passphrase": "$passphrase"}'
                                                        config server:sshkey::delete
The config server:sshkey::delete command enables you to delete an SSH key from the Control-M/Server.
This API command is planned to be deprecated soon. Use config server:sshkey::deleteSshKey instead.
CLI Syntax
ctm config server:sshkey::delete <server> <keyName> <passphrase>
                                                    The following table describes the config server:sshkey::delete command parameters.
| 
                                                                 Parameter  | 
                                                            
                                                                 Description  | 
                                                        
|---|---|
| 
                                                                 server  | 
                                                            
                                                                 Defines the Control-M/Server name.  | 
                                                        
| 
                                                                 keyName  | 
                                                            
                                                                 Defines the key name. Valid Values: 1–256 alphanumeric characters and _ (underscores).  | 
                                                        
| 
                                                                 passphrase  | 
                                                            
                                                                 Defines the key file password, which is encrypted with RunAsUserEncryptionHelper.  | 
                                                        
REST API Syntax
cURL:
server=IN01
curl -H "x-api-key: $token" -H "Content-Type: application/json" -X DELETE
"%endpoint%/config/server/$server/sshkey/$keyName/$passphrase"
                                                        config server:sshKeysList::get
The config server:sshKeysList::get command enables you to get the SSH key data from all objects.
CLI Syntax
ctm config server:sshKeysList::get <server> [-s <search query>]
                                                    Where <server> defines the Control-M/Server name.
You can use the optional -s switch to run a search with the query string format field1=criteria1&field2=criteria2&field3=criteria3, which contains the following supported fields:
The following table describes the available config server:shKeysList::get query fields.
| 
                                                                 Field  | 
                                                            
                                                                 Description  | 
                                                        
|---|---|
| 
                                                                 keyName  | 
                                                            
                                                                 Defines the key name. Valid Values: 1–256 alphanumeric characters and _ (underscores). Supported wildcards are * and ?.  | 
                                                        
| 
                                                                 format  | 
                                                            
                                                                 Determines the format of the SSH key, as follows: 
  | 
                                                        
| 
                                                                 type  | 
                                                            
                                                                 Determines the type of SSH key, as follows: 
  | 
                                                        
REST API Syntax
cURL:
server=IN01
curl -H "x-api-key: $token" -H "Content-Type: application/json" -X GET
"%endpoint%/config/server/$server/sshKeysList?keyName=b*&format=SSH2"
                                                        config server:sshkey:getSshKey::get
The config server:sshkey:getSshKey::get command enables you to save a public key on your Agent and transfer it to an Agentless Host.
CLI Syntax
ctm config server:sshkey:getSshKey::get <server> <keyName> <passphrase>
                                                    The following table describes the config server:sshkey:getSshKey::get command parameters.
| 
                                                                 Parameter  | 
                                                            
                                                                 Description  | 
                                                        
|---|---|
| 
                                                                 server  | 
                                                            
                                                                 Defines the Control-M/Server name.  | 
                                                        
| 
                                                                 keyName  | 
                                                            
                                                                 Defines the key name. Valid Values: 1–256 alphanumeric characters and _ (underscores).  | 
                                                        
| 
                                                                 passphrase  | 
                                                            
                                                                 Defines the key file password, which is encrypted with RunAsUserEncryptionHelper.  | 
                                                        
REST API Syntax
cURL:
server=IN01
curl -H "x-api-key: $token" -H "Content-Type: application/json" -X POST
"%endpoint%/config/server/$server/sshkey/getSshKey"
-d '{"keyName": "$keyName","passphrase": "$passphrase"}'
                                                        config server:sshkey::get
The config server:sshkey::get command enables you to save a public key on your Agent and transfer it to an Agentless Host.
This API command is planned to be deprecated soon. Use config server:sshkey:getSshKey::get instead.
CLI Syntax
ctm config server:sshkey::get <server> <keyName> <passphrase>
                                                    The following table describes the config server:sshkey::get command parameters.
| 
                                                                 Parameter  | 
                                                            
                                                                 Description  | 
                                                        
|---|---|
| 
                                                                 server  | 
                                                            
                                                                 Defines the Control-M/Server name.  | 
                                                        
| 
                                                                 keyName  | 
                                                            
                                                                 Defines the key name. Valid Values: 1–256 alphanumeric characters and _ (underscores).  | 
                                                        
| 
                                                                 passphrase  | 
                                                            
                                                                 Defines the key file password, which is encrypted with RunAsUserEncryptionHelper.  | 
                                                        
REST API Syntax
cURL:
server=IN01
curl -H "x-api-key: $token" -H "Content-Type: application/json" -X GET
"%endpoint%/config/server/$server/sshkey/$keyName/$passphrase"
                                                        