ssh_readme

SSH Components

Introduction

SSH components provides Smarfrog components for executing a command on a remote machine and copy file to/from a remote machine over SSH.

How to build

  1. First build smarfrog framework by running ant dist in core/smartfrog

  2. Build ant tasks by running ant in core/extras/ant

  3. Build ssh by running ant in core/components/ssh

  4. Copy following jar files from core/components/ssh/ build/dist/lib to core/smartfrog/dist/lib or update class path for the SmartFrog daemon.

    1. jsch-20040505.jar

    2. sshComponents.jar

Usage

SCP Component

SCP component is deployed as a Smarfrog component. It can be used to copy files (upload/download) to/from a remote host securely.

Attributes

Table1
Attribute NameDescriptionOptional/Mandatory
hostMachine running ssh daemonMandatory
userIdUser login Id Mandatory
passwordFileFile containing password Mandatory
localFilesComma separated path to local files, in the form of a vectorMandatory
remoteFilesComma separated path to remote files, in the form of a vectorMandatory
transferTypeType of file transfer (Upload ot download)Mandatory (Possible values are "get" and "put")
portPortOptional (default value is 22)
shouldTerminateShould terminate this component after processsing or notOptional ( Default is true)

Please refer to sshExample.sf for a sample usage of SCP component.

SSHExec Component

SSHExec component is deployed as a Smarfrog component. It can be used to remotely execute commands securely over SSH.

Attributes

Table2
Attribute NameDescriptionOptional/Mandatory
hostHost running ssh daemonMandatory
usetIdLogin IDMandatory
commandsComma separated list of command to be executed in SSH session.Mandatory
passwordFileFile containing password of user.Mandatory
timeoutTimout for commands executionOptional ( default value is 0)
portPortOptional (default value is 22)
failOnErrorTerminate if any command fails.Optional (Default is true)
shouldTerminateBoolean attribute enables self termination of the SSHExec component after executing SSHExec commands.Optional ( Default is true)

Please refer to sshExecExample.sf for a sample usage of SSHExec component.