# Resin local ssh on win10: "syntax error near unexpected token \`then'"

**URL:** <https://forums.balena.io/t/resin-local-ssh-on-win10-syntax-error-near-unexpected-token-then/3066>\
**Category:** Product support\
**Tags:** raspberrypi3\
**Created:** [May 3, 2018, 11:45am UTC](https://forums.balena.io/t/resin-local-ssh-on-win10-syntax-error-near-unexpected-token-then/3066 "2018-05-03T11:45:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![strantam](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@strantam](https://forums.balena.io/u/strantam)\
**Post date:** [May 3, 2018, 11:45am UTC](https://forums.balena.io/t/resin-local-ssh-on-win10-syntax-error-near-unexpected-token-then/3066/1 "2018-05-03T11:45:53Z")

</div>

Local ssh ("resin local ssh ") fails with the following error when trying to connect, both to supervisor, and local app:

sh: -c: line 0: syntax error near unexpected token `then' sh: -c: line 0:`(if [-f /usr/bin/balena]; then echo \"balena\"; else echo \"docker\"; fi) exec -ti 748901cc1e35a844b777ca9d62126b8ebf19253873f4b75c0cc0edb24ef227b8 /bin/sh -c ‘if [-e /bin/bash]; then exec /bin/bash; else exec /bin/sh; fi’"’

"resin local ssh "![resinlocalssherror|690x430] --host command works.

Here is the detailed log when running the command with -v flag  
(upload://zclvqD69YsOZMtcywz9SudYW36y.PNG)

Could someone help me what can be the couse of the problem?

---

<div class="post-metadata">

**Author:** ![pcarranzav](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pcarranzav/32/94_2.png) [@pcarranzav](https://forums.balena.io/u/pcarranzav)\
**Post date:** [May 3, 2018, 3:36pm UTC](https://forums.balena.io/t/resin-local-ssh-on-win10-syntax-error-near-unexpected-token-then/3066/4 "2018-05-03T15:36:46Z")

</div>

Hi @strantam - what resin CLI version are you using, and what resinOS version is the device you’re trying to ssh into?

---

<div class="post-metadata">

**Author:** ![strantam](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@strantam](https://forums.balena.io/u/strantam)\
**Post date:** [May 7, 2018, 12:15pm UTC](https://forums.balena.io/t/resin-local-ssh-on-win10-syntax-error-near-unexpected-token-then/3066/6 "2018-05-07T12:15:37Z")

</div>

Hi,  
Version are:

- resin-cli: 7.3.8
- Resin OS: 2.12.6+rev1 (dev)

---

<div class="post-metadata">

**Author:** ![pcarranzav](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pcarranzav/32/94_2.png) [@pcarranzav](https://forums.balena.io/u/pcarranzav)\
**Post date:** [May 8, 2018, 9:37pm UTC](https://forums.balena.io/t/resin-local-ssh-on-win10-syntax-error-near-unexpected-token-then/3066/9 "2018-05-08T21:37:23Z")

</div>

Thanks @strantam! I’ve filed a bug report on the CLI repo and the CLI team will look into it: [https://github.com/resin-io/resin-cli/issues/876](https://github.com/resin-io/resin-cli/issues/876)

---

<div class="post-metadata">

**Author:** ![pimterry](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/pimterry/32/140_2.png) [@pimterry](https://forums.balena.io/u/pimterry)\
**Post date:** [May 9, 2018, 4:20pm UTC](https://forums.balena.io/t/resin-local-ssh-on-win10-syntax-error-near-unexpected-token-then/3066/11 "2018-05-09T16:20:14Z")

</div>

Hi @strantam, I’m investigating this now, but I can’t reproduce it. I think it might be environment-specific, and this is an error coming from your shell when the CLI tries to pass it a complex SSH command.

Could you let me know what OS you’re using, and what shell?

It looks like you’ve tried to include some attachments here too, but I can’t see them. Can you try to upload those again?

---

<div class="post-metadata">

**Author:** ![strantam](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@strantam](https://forums.balena.io/u/strantam)\
**Post date:** [May 10, 2018, 3:44pm UTC](https://forums.balena.io/t/resin-local-ssh-on-win10-syntax-error-near-unexpected-token-then/3066/12 "2018-05-10T15:44:43Z")

</div>

Hi pimterry,  
I’m using win10, and so far I was trying with plain cmd, and git bash. Cmd fails with errormsg, but git bash has no feedback.

Here is the error from cmd:

 ![resinlocalssherror](https://global.discourse-cdn.com/balena/original/1X/f6b162fd19d6e1fc3d80bcdf7c6c7e6703eec072.PNG)
