ByteChef LogoByteChef

SSH

SSH (Secure Shell) is a network protocol for secure access to remote hosts. It allows running shell commands on a remote host over an encrypted connection.

Categories: Developer Tools, Helpers

Type: ssh/v1


Connections

Version: 1

Username and Password

Properties

NameLabelTypeDescriptionRequired
hostHostSTRINGThe hostname or IP address of the SSH server.true
portPortINTEGERThe port number of the SSH server.false
usernameUsernameSTRINGThe username used to log in to the SSH server.true
passwordPasswordSTRINGThe password of the user logging in to the SSH server.true
hostKeyFingerprintHost Key FingerprintSTRINGThe fingerprint of the SSH server's host key, for example SHA256:l5H0Bq1qGZaBb5Tn7s0AaCnNmCHiBBKvKPhTE7hrXTI. When left empty, any host key is accepted, which leaves the connection open to man-in-the-middle attacks.false

Private Key

Properties

NameLabelTypeDescriptionRequired
hostHostSTRINGThe hostname or IP address of the SSH server.true
portPortINTEGERThe port number of the SSH server.false
usernameUsernameSTRINGThe username used to log in to the SSH server.true
privateKeyPrivate KeySTRINGThe private key of the user logging in to the SSH server, in OpenSSH or PEM format, including the header and the footer line.true
passphrasePassphraseSTRINGThe passphrase protecting the private key, if the key is encrypted.false
hostKeyFingerprintHost Key FingerprintSTRINGThe fingerprint of the SSH server's host key, for example SHA256:l5H0Bq1qGZaBb5Tn7s0AaCnNmCHiBBKvKPhTE7hrXTI. When left empty, any host key is accepted, which leaves the connection open to man-in-the-middle attacks.false

Actions

Execute Commands

Name: execute

Executes shell commands on a remote host over SSH and returns the output of every command. Each command runs in its own session, so a working directory or an environment variable set by one command is not visible to the next one. Chain such commands instead, for example 'cd /var/log && ls -la'.

Properties

NameLabelTypeDescriptionRequired
commandsCommandsARRAY
Items [STRING]
The shell commands to execute on the remote host, in the order they are listed.true
continueOnErrorContinue On ErrorBOOLEAN
Options true, false
Keep executing the remaining commands when a command exits with a non-zero exit status. When disabled, execution stops at the first failed command and the output collected so far is returned.false
timeoutTimeoutINTEGERThe number of seconds to wait for a single command to finish.false

Example JSON Structure

{
  "label" : "Execute Commands",
  "name" : "execute",
  "parameters" : {
    "commands" : [ "" ],
    "continueOnError" : false,
    "timeout" : 1
  },
  "type" : "ssh/v1/execute"
}

Output

Type: ARRAY

Items Type: OBJECT

Properties

NameTypeDescription
commandSTRINGThe executed command.
resultSTRINGThe standard output of the command.
errorSTRINGThe standard error output of the command.
exitStatusINTEGERThe exit status of the command, 0 on success.

Output Example

[ {
  "command" : "",
  "result" : "",
  "error" : "",
  "exitStatus" : 1
} ]

How is this guide?

Last updated on

On this page