# OpenSSH Launch failed

**URL:** https://community.jenkins.io/t/openssh-launch-failed/6213
**Category:** Ask a question
**Created:** [March 11, 2023, 7:33pm UTC](https://community.jenkins.io/t/openssh-launch-failed/6213 "2023-03-11T19:33:25Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![omar](https://avatars.discourse-cdn.com/v4/letter/o/f0a364/32.png) [@omar](https://community.jenkins.io/u/omar)
#### Post date: [March 11, 2023, 7:33pm UTC](https://community.jenkins.io/t/openssh-launch-failed/6213/1 "2023-03-11T19:33:25Z")

</div>

Hello there,

I am trying to start agent throw OpenSSH. I have set up the private key on jenkins controller and the public on node. when i launch the agent it throw this error:

Searching for 172.16.30.144 in C:\Users\Administrator.ssh\known\_hosts  
Searching for 172.16.30.144:22 in C:\Users\Administrator.ssh\known\_hosts  
[03/11/23 20:32:29] [SSH] SSH host key matches key in Known Hosts file. Connection will be allowed.  
[03/11/23 20:32:29] [SSH] Authentication successful.  
[03/11/23 20:32:29] [SSH] The remote user’s environment is:  
Set-Variable : Cannot process command because of one or more missing mandatory parameters: Name.  
At line:1 char:1

- set
- 

```auto
  + CategoryInfo : InvalidArgument: (:) [Set-Variable], ParameterBindingException
  + FullyQualifiedErrorId : MissingMandatoryParameter,Microsoft.PowerShell.Commands.SetVariableCommand

```

Checking Java version in the PATH  
java : The term ‘java’ is not recognized as the name of a cmdlet, function, script file, or operable program. Check  
the spelling of the name, or if a path was included, verify that the path is correct and try again.  
At line:1 char:1

- java -version
- 

```auto
  + CategoryInfo : ObjectNotFound: (java:String) [], CommandNotFoundException
  + FullyQualifiedErrorId : CommandNotFoundException

```

Java is not in the PATH nor configured with the javaPath setting, Jenkins will try to guess where is Java, this guess will be removed in the future. :Launch agents via SSH  
[03/11/23 20:32:30] [SSH] Checking java version of C:/tools/jenkins-agent/jdk/bin/java  
[03/11/23 20:32:30] [SSH] C:/tools/jenkins-agent/jdk/bin/java -version returned 11.0.18.  
[03/11/23 20:32:30] [SSH] Starting sftp client.  
[03/11/23 20:32:31] [SSH] Copying latest remoting.jar…  
Source agent hash is 25B899E9C1FD1001F55EF1A8DB224323. Installed agent hash is 25B899E9C1FD1001F55EF1A8DB224323  
Verified agent jar. No update is necessary.  
Expanded the channel window size to 4MB  
[03/11/23 20:32:31] [SSH] Starting agent process: cd “C:/tools/jenkins-agent” && C:/tools/jenkins-agent/jdk/bin/java -jar remoting.jar -workDir C:/tools/jenkins-agent -jar-cache C:/tools/jenkins-agent/remoting/jarCache  
At line:1 char:27

- cd C:/tools/jenkins-agent && C:/tools/jenkins-agent/jdk/bin/java -ja …
- 

```
                      ~~

```

The token ‘&&’ is not a valid statement separator in this version.  
+ CategoryInfo : ParserError: (🙂 , ParentContainsErrorRecordException  
+ FullyQualifiedErrorId : InvalidEndOfLine

Agent JVM has terminated. Exit code=1  
[03/11/23 20:32:31] Launch failed - cleaning up connection  
[03/11/23 20:32:31] [SSH] Connection closed.

---

<div class="post-metadata">

### Author: ![slide\_o\_mix](https://dub1.discourse-cdn.com/flex013/user_avatar/community.jenkins.io/slide_o_mix/32/20977_2.png) [@slide\_o\_mix](https://community.jenkins.io/u/slide_o_mix)
#### Post date: [March 12, 2023, 2:06pm UTC](https://community.jenkins.io/t/openssh-launch-failed/6213/2 "2023-03-12T14:06:35Z")

</div>

Look at the bottom of this page [ssh-slaves-plugin/CONFIGURE.md at 365f5ebabeec6eb5932c7b6afed8695ba4f3a15d · jenkinsci/ssh-slaves-plugin · GitHub](https://github.com/jenkinsci/ssh-slaves-plugin/blob/365f5ebabeec6eb5932c7b6afed8695ba4f3a15d/doc/CONFIGURE.md)

If you have PowerShell as your default shell on the Windows machine, you have to add some pre-command and post-command stuff.
