Introduction
- The JS7 - JITL SSH job allows execution of shell commands and scripts on a remote host running an SSH server without requiring a local SSH client to be installed.
- To log in to remote systems using a pair of keys. in this example we added the client's public key to the remote server with the
authorized_keys
file in the.ssh/
sub-directory of the target account's home directory.
Workflow
The 11_AgentlessScheduling folder includes two workflows that use the JITL com.sos.jitl.jobs.ssh.SSHJob
class with the arguments host
, port
, auth_method
, command
etc. to login to the SSH server:
- jdSSHPublicKeyAuthentication: In this workflow, the command parameter is used to execute a single command on the remote server.
- jdSSHScriptPublicKeyAuthentication: In this workflow, the command_script parameter is used to run a full-blown script on the remote server. You can add the contents of a shell script to the
command_script
parameter it will execute the script on the remote server.
To execute the workflow from the 11_AgentlessScheduling folder follow the below steps:
- Click on the 11_AgentlessScheduling folder and expand any of the workflows The following examples uses jdSSHScriptPublicKeyAuthentication.
- To add an order to the workflow, click the action menu of the workflow and select Add Order from the drop-down menu.
- When clicking Add Order a popup window will appear.
- You can add an Order ID or leave the Order ID value empty, it will then use a default Order ID. Click the Submit button.
- To check the status of the order click the name of the workflow. This will make the Order History panel appear.
- From the Order History panel, you can verify that the order is successful and finished. Click the Order ID to see the log output created by jobs executed for this order.
- A log view window will open and the order log will be displayed. This log contains the output of all jobs executed by the order. You can see the remote hostname for the SSH server is displayed.
- You can download the log file by clicking the Download button from the upper right corner of the log view window. Also, you can expand and collapse the individual job output using the chevron icons from the left upper corner of the log view window.
Overview
Content Tools