0

I tried to connect a Windows machine that exist in another domain than our TFS 2018.3 exist.

I added "SSH" task, and I created new SSH endpoint with the remote machine IP, username and password, without a private key. I configured in the remote machine access of SSH for this username & password.

In the SSH task, I configure a simple shell command: ls.

The TFS agent succeeded to connect the machine but failed with this error:

Unable to execute command or shell on remote system: Failed to Execute process.

Full log:

2019-08-15T13:22:54.1491966Z Trying to setup SSH connection to ********@myserverinanotherdomain:22

2019-08-15T13:22:54.4085564Z Successfully connected.

2019-08-15T13:22:54.8120684Z tr -d '\015' <"./sshscript_1565875374136" > "./sshscript_1565875374136._unix"

2019-08-15T13:22:54.8121422Z Unable to execute command or shell on remote system: Failed to Execute process.

2019-08-15T13:22:54.8121745Z

2019-08-15T13:22:54.8180230Z ##[error]Command tr -d '\015' <"./sshscript_1565875374136" > "./sshscript_1565875374136._unix" exited with code 4294967295.

I think because it's a Windows machine and I try to execute a shell script. If I will install Git bash, for example, it can help?

Does the SSh task support only Linux machines? if yes, how can I connect a machine that exists in another domain?

Shayki Abramczyk
  • 36,824
  • 16
  • 89
  • 114

1 Answers1

0

SSH being a communication protocol is agnostic of OS. It is not Linux specific. But there seems to be a limitation for using SSH task on windows machine/build agent. Take a look at this similar question here: Not able to run bash script from windows using vsts.

I haven't found a documentation that clearly declare the SSh task not support on Windows machine. But I have found a task which also uses SSH--Copy Files Over SSH task. And according to the Q&A in official link:

Is this task supported for target machines running operating systems other than Linux?

This task is intended for target machines running Linux.

  • For copying files to a macOS machine, this task may be used, but authenticating with a password is not supported.
  • For copying files to a Windows machine, consider using Windows Machine File Copy.

Instead of SSH. You should be able to use a local account on the build server and when entering the credentials. The account must have the same password as the account in the other domain. In other works make sure build account which run on the build agent are able to connect another domain.

Also make sure there is a trust relationship between the domains.

PatrickLu-MSFT
  • 49,478
  • 5
  • 35
  • 62