With this plugin, the CloudBees CD/RO server and securely connect to a remote host to remotely execute commands, transfer files, and run scripts.
Plugin version 1.2.5.2021022505
Revised on Feb 23, 2021
Supported operating systems
This plugin has been tested with the following Operating Systems on the Remote Host.
-
Ubuntu
-
Solaris
-
RHEL
-
Debian
Note that the OS of the CloudBees CD Server and Agent used to execute the plugin can be either Linux or Windows.
Document convention
All mandatory/required parameters in all procedures (including Configuration Procedure) are marked in bold italics.
Plugin configurations
Plugin configurations are sets of parameters that apply across some or all of the plugin procedures. They reduce repetition of common values, create predefined parameter sets for end users, and securely store credentials where needed. Each configuration is given a unique name that is entered in designated parameters on procedures that use them.
Creating plugin configurations
To create plugin configurations in CloudBees CD, do these steps:
-
Go to
to open the Plugin Manager. -
Find the EC-RemoteAccess-1.2.5.2021022505 row.
-
Click Configure to open the Configurations page.
-
Click Create Configuration as per the description of parameters below.
Configuration procedure parameters
Parameter | Description |
---|---|
CloudBees CD Information | |
Configuration | Required. Unique name for the plugin configuration. |
Description | Description for the plugin configuration. |
Log Level | Log level to use for logging output. Possible values are DEBUG, INFO, WARN, ERROR |
Test Connection? | If selected test connection will be performed during creation of the configuration. |
Remote Host Details | |
Host Address | Required. Remote Host address. |
Port | Port for SSH connection. |
OS | Required. OS of the Remote Host. Currently the only value supported is Linux. |
Script Destination Directory | Directory on remote machine where temporary script file created by the plugin will be transferred to. This file will be removed after its execution. This directory is required to have the correct permissions to enable both the Connection user as well as the Target user to use it. |
Remote Action | |
Remote Action | Required. Type of Remote action. Currently the only value supported is Execute Command. |
Connection Protocol | |
Protocol | Required. Type of connection protocol. Currently the only value supported is SSH. |
File Transfer Type | Required. Indicates the File Transfer Type used to transfer the plugin created temporary script file. Supported values are SFTP and SCP. |
Connection Details | |
Connect With | Type of User Authentication. Supported values are password, private key and private key file. |
Connect Credential (Username and Password) | Username and password to connect. |
Connect Credential (Username and Private Key) | Username and private key to connect. |
Connect Credential (Username and Private Key File) | Username and private key file to connect. |
Private Key Passphrase | Passphrase used along with the private key. This parameter applies only when the connect uses a private key or a private key file. |
Target User Information | |
Is Target User Same as Connection User? | If checked the plugin will execute commands as the Connection User. In this case, the plugin will not prefix SUDO or SU before executing the command. Default is Yes. |
Target User Runas Identity | Applies only when the Target User is not the same as Connection User. Plugin will add a prefix as follows before executing the command, based on the Value chosen for this parameter. If Value = SUDO, plugin will perform the following: sudo <command> If Value = SU, plugin will perform the following: su -c <command> If Value = SUDO WITH USERNAME, plugin will perform the following: sudo -u <TargetUserName> <command> If Value = SU WITH USERNAME, plugin will perform the following: su - <TargetUserName> -c <command> |
Target Username | Applies only when "Is Target User Same as Connection User?" is 'no' and "Target User Runas Identity" is either "SUDO WITH USERNAME" or "SU WITH USERNAME". |
Interactivity Information | |
Is Interactive Mode Enabled? | If Yes, plugin will look for prompts thrown in the standard output by the script that the plugin executes. For example the executing script could expect an argument supplied to it interactively during its execution. Default is No. |
Prompt Pattern Type | Applies only when Inter active mode is enabled. Indicates if the prompt thrown by the script is a Credential or Plain Text. If the prompt is a Credential values supplied to it would be considered a secret and will not be surfaced anywhere in CloudBees CD (either in the UI or Logs). Default is Credential. |
Prompt Pattern | Applies only when Interactive mode is enabled. Can be either an exact string or a pattern the plugin will look for. For example password: or .[Pp]assword.: |
Prompt Pattern Value (Credential) | Applies only when Interactive mode is enabled. The value that the plugin will supply to the prompt any time the prompt matches the Prompt Pattern parameter and the Prompt pattern type is Credential. |
Prompt Pattern Value (Plain Text) | Applies only when Interactive mode is enabled. The value that the plugin will supply to the prompt any time the prompt matches the Prompt Pattern parameter and the Prompt pattern type is Plain Text. |
Plugin procedures
Run Custom Command
Use this procedure to execute a command on a remote host.
Run Custom Command parameters
Parameter | Description |
---|---|
Configuration Name | Required. Provide the name of the plugin configuration to be used. |
Script | Required. Enter either a single command or the contents of a script that needs to be executed. For example this could be a single command like hostname or a script as follows #!/bin/bash echo "Hello World" >> /tmp/test In both cases above, the plugin would transfer the contents as a script to be executed on the Remote Host. |
Remote Path | Path on the Remote Host where the plugin will execute the script. Default will be the default directory when connecting to remote machine by specific user. This directory is required to have the correct permissions to enable both the Connection user as well as the Target user to use it. |
Result Property Path | If provided command output, error output and exit value will be stored in properties whose names are remoteCommandOutput, remoteCommandErrorOutput and remoteCommandExitValue respectively. |
Known issues
When "Run Custom Command" procedure is executed in interactive mode, the plugin cannot distinguish between command output vs errors in stdout. Consequently they both will be reported together in the remoteCommandOutput parameter and no warning will be reported in Job Summary if there any errors thrown in stdout when the command has otherwise succeeded.
Release notes
EC-RemoteAccess 1.2.0
-
Add checking connection while creating/editing a configuration.
-
Fixed issues in the RunCustomCommand procedure when Flow Agent runs on Java 11.
EC-RemoteAccess 1.1.0
-
Provisioning of Binary Dependencies (for example Grape jars) in the agent resource, required by this plugin, is now delivered through a newly introduced mechanism called Plugin Dependency Management. Binary dependencies will now be seamlessly delivered to the agent resource from the Flow Server, any time a new version of a plugin is invoked the first time. Flow Repository set up is no longer required for this plugin.