RemoteHostAuthentication - createSshRemoteHostAuthentication_1
RemoteHostAuthentication - createSshRemoteHostAuthentication
Description :
This command creates a Remote Host Authentication for the SSH Execution Protocols. You must specify a valid SSH port for this Remote Host Authentication.
The valid executionProtocolId numbers and their respective display names are as follows:
- 1 - SSH
- 2 - SSH + SUDO
- 3 - SSH + SU
Return type : com.bladelogic.om.infra.model.remotehostauthentication.RemoteHostAuthentication
Command Input :
Variable Name | Variable Type | Description |
|---|---|---|
name | String | Name of the Remote Host Authentication. |
description | String | Description of the Remote Host Authentication. |
executionProtocolId | Integer | Execution Protocol ID. Execute RemoteHostAuthentication listExecutionProtocols for a list of valid values. |
automationPrincipalName | String | Automation Principal Name. |
superUserAutomationPrincipalName | String | Super User Automation Principal Name. This is only used for SSH + SU protocol. For other protocols, use "". |
sshPortNumber | Integer | SSH Port Number. |
Example
The following example creates an SSH Remote Host Authentication. It will then query the RemoteHostAuthentication object that was returned for the name. This example will utilize the NSH Performance Commands for execution purposes.
Script
# Set the serviceProfileName (myProfile) that the NSH Performance Commands will use.
# The username/password for this serviceProfileName must be cached with the blcred command.
blcli_setoption serviceProfileName myProfile
# Create the Remote Host Authentication targeting port 22 and using the SSH Execution Protocol.
blcli_execute RemoteHostAuthentication createSshRemoteHostAuthentication myLinuxAuthentication "Auth for Linux" 1 LdapAutoPrinc "" 22
# The above command will return something like "com.bladelogic.om.infra.model.remotehostauthentication.RemoteHostAuthenticationImpl@9f069f"
# This is a BLCLI reference to the Remote Host Authentication which was just created.
# You can then execute additional RemoteHostAuthentication BLCLI calls to query things like id and name.
blcli_execute RemoteHostAuthentication getName
# The above command will execute directly on the Remote Host Execution returned from the initial blcli_execute call.
# It will return a value like myLinuxAuthentication.