Deploy: SSH

VSTS | TFS 2018 | TFS 2017

icon Run shell commands or a script on a remote machine using SSH.

This task enables you to connect to a remote machine using SSH and run commands or a script.

Prerequisites

  • The task supports use of an SSH key pair to connect to the remote machine(s).
  • The public key must be pre-installed or copied to the remote machine(s).

Arguments

Argument Description
SSH endpoint The name of an SSH service endpoint containing connection details for the remote machine. The hostname or IP address of the remote machine, the port number, and the user name are required to create an SSH endpoint.
- The private key and the passphrase must be specified for authentication.
- A password can be used to authenticate to remote Linux machines, but this is not supported for macOS or Windows systems.
Run Choose to run either shell commands or a shell script on the remote machine.
Commands The shell commands to run on the remote machine. This parameter is available only when Commands is selected for the Run option. Enter each command together with its arguments on a new line of the multi-line textbox. To run multiple commands together, enter them on the same line separated by semicolons. Example: cd /home/user/myFolder;build
Shell script path Path to the shell script file to run on the remote machine. This parameter is available only when Shell script is selected for the Run option.
Arguments The arguments to pass to the shell script. This parameter is available only when Shell script is selected for the Run option.
Advanced - Fail on STDERR If this option is selected (the default), the build will fail if the remote commands or script write to STDERR.
Control options See Control options

See also

Q&A

Do I need an agent?

You need at least one agent to run your build or release. Get an agent.

I can't select a default agent queue and I can't queue my build or release. How do I fix this?

See Agent pools and queues.

I use TFS on-premises and I don't see some of these features. Why not?

Some of these features are available only on VSTS and not yet available on-premises. Some features are available on-premises if you have upgraded to the latest version of TFS.

Help and support