Cannot connect to Windows (10/11/Server) via SSH
Discord username (optional)
No response
Describe the bug
I want to login to my windows computer through SSH. Here is how I setup my Windows SSH server: https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh_install_firstuse?tabs=powershell
After all setup, I tried to login to my Windows using Warp. I successfully login to my computer then the session end.

It works totally fine on my default terminal.app, but Warp not working.
To Reproduce
- Setup a Windows SSH Server;
- Try to login;
Expected behaviour
No response
Screenshots
No response
Operating System
MacOS
OS Version
13.1 (22C65)
Shell Version
zsh 5.8.1 (x86_64-apple-darwin22.0)
Warp Version
v0.2022.12.13.08.04.stable_01
Additional context
No response
Does this block you from using Warp daily?
Yes, this issue prevents me from using Warp daily.
Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e
None
Thank you, @Molin-L, for your input!
We will keep you updated on any developments regarding this issue through this thread.
Also, as @osmboy mentioned, you can workaround this issue by installing installing Cygwin on the Windows machine you'd like to connect to.
If the above workaround isn't helping, you can disable the SSH wrapper by navigating to Settings > Features. This will allow SSH to function normally, although it may disable Blocks functionality.
In the meantime, if you're experiencing the same issue, please consider adding a 👍 to the original post at the top or commenting with your details. Your contribution will help us understand the extent of the issue. Additionally, if you would like to receive notifications about any updates related to this issue, please click on the subscribe button.
Thank you for your understanding and patience as we work towards resolving this issue.
Same here. It says:
$ ssh user@host
'export' is not recognized as an internal or external command,
operable program or batch file.
Connection to host closed.
workaround: you can install cygwin on windows then ssh
This fix is not working for me. I have Cgywin installed and from the Terminal app, I can SSH and invoke bash with no issue. However, when I try to connect from Warp, The following error flashes for a split second before the connection drops:
~
Missing '(' after 'if' in if statement.
This fix is not working for me. I have Cgywin installed and from the Terminal app, I can SSH and invoke
bashwith no issue. However, when I try to connect from Warp, The following error flashes for a split second before the connection drops:~ Missing '(' after 'if' in if statement.
This error is probably thrown by powershell. You may have to disable windows own openssh server and then configure and start ssh daemon on cygwin
Hey @gordon8214 -- the issue is most likely that Warp's ssh wrapper is being invoked and attempting to 'Warpify' the SSH session -- which won't work because Warp doesn't currently support Powershell.
You can circumvent Warp's ssh wrapper by prefixing command to your ssh command, e.g.
command ssh user@host
Or you can disable Warp's SSH wrapper altogether in the 'Features' settings page:
Just leaving a comment to let you know it is not only on Windows Server. This happen on Windows 11 as well.
I'm here to report that I too am having this problem. Attempting to ssh from a Macbook to Windows 11. Here's the permalink to the command execution/output: https://app.warp.dev/block/kmiRSX8mEllNVdFZ0u3AIw
Alternatively, you can also switch to using another shell without the warp wrapper and then connect:
$ zsh
$ ssh [email protected]
After switching to zsh (or whatever shell you prefer) Warp asks in the UI whether you want to wrap that shell, just ignore it.
Is there any date when this is going to be resolved?
Hi, any update on this?
Same here. It says:
$ ssh user@host 'export' is not recognized as an internal or external command, operable program or batch file. Connection to host closed.
same output. ssh with macOS native terminal works fine.
it seems like warp will export some environment parameters to ssh server but windows powershell does not support this kind of shell command?
Since we're tracking all SSH on Windows issues here, let me post the output that I am getting when trying to SSH into a Windows 11 host from Mac OS. I believe users in #1729 and #2027 were experiencing the same behavior or something similar.
❯ ssh windows
At line:5 char:3
+ if test ${SHELL##*/} != bash -a ${SHELL##*/} != zsh; then
+ ~
Missing '(' after 'if' in if statement.
At line:6 char:4
+ if test ! -e $HOME/.hushlogin; then
+ ~
Missing '(' after 'if' in if statement.
At line:7 char:4
+ if test -r /etc/motd; then
+ ~
Missing '(' after 'if' in if statement.
At line:19 char:4
+ if test -r /etc/profile; then
+ ~
Missing '(' after 'if' in if statement.
At line:25 char:6
+ bash)
+ ~
Unexpected token ')' in expression or statement.
At line:35 char:35
+ printf '\''\eP$d%s\x9c'\'' $_msg'
+ ~
Missing closing ')' in expression.
At line:26 char:29
+ exec -a bash bash --rcfile <(echo '
+ ~
The '<' operator is reserved for future use.
At line:37 char:2
+ )
+ ~
Unexpected token ')' in expression or statement.
At line:39 char:5
+ zsh) WARP_TMP_DIR=$(command -p mktemp -d warptmp.XXXXXX)
+ ~
Unexpected token ')' in expression or statement.
At line:42 char:4
+ if [[ $? == 0 ]]; then
+ ~
Missing '(' after 'if' in if statement.
Not all parse errors were reported. Correct the reported errors and try
again.
+ CategoryInfo : ParserError: (:) [], ParentContainsErrorRecordE
xception
+ FullyQualifiedErrorId : MissingOpenParenthesisInIfStatement
Connection to windows closed.
As JKuhn mentioned, using a non-warpified ZSH works just fine.
❯ zsh
❯ ssh windows
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Install the latest PowerShell for new features and improvements! https://aka.ms/PSWindows
PS C:\Users\user>
command ssh user@windows works just fine. Tested on latest version of Windows 11 and macOS.
I was trying this from Mac to Windows 11. I have the Windows SSH server set to use PowerShell as the default shell, and I'm also getting the Missing '(' after 'if' in if statement. I had previously been seeing the export error when defaulting to what I believe was the cmd.exe shell.
See also: https://learn.microsoft.com/en-us/windows-server/administration/openssh/openssh-server-configuration#configuring-the-default-shell-for-openssh-in-windows
command ssh [...] does work, but not as one would like with warpify and such.
I'd hazard a guess this is related: https://github.com/warpdotdev/Warp/issues/6012, which leaves command ssh [...] as just not breaking.
Alternatively, using Enter-PSSession - HostName hostname -UserName username from pwsh on Mac seems to be using the client PowerShell settings, rather than the host. e.g. I have Oh My Posh set up on the host, and using command ssh [...] shows it, while from Enter-PSSession [...], it doesn't seem like the profile gets loaded. No Warpify either way, but one might be preferable to the other based on the use case.
I'm experiencing the same issue when connecting from Warp on macOS to a Windows host over SSH. The connection works correctly from the native macOS Terminal, but in Warp it disconnects immediately after login/authentication. This is currently blocking me from using Warp for SSH access to that Windows machine.