Warp
Warp copied to clipboard
SSH fails for specific host
Discord username (optional)
wuh#5913
Describe the bug
I have a bunch of SSH hosts set up in my ~/.ssh/config file and till now everything's worked fine using Warp to SSH in to each one. Hit a snag today on a WPEngine host though, here is the output:
bash: -c: line 0: syntax error near unexpected token `then'
bash: -c: line 0: `export TERM_PROGRAM=WarpTerminal _user=$(command -v whoami >/dev/null 2>&1 && command whoami 2>/dev/null || echo $USER) _hostname=$(command -v hostname >/dev/null 2>&1 && command hostname 2>/dev/null || uname -n) hook=$(printf {"hook": "SSH", "value": {"socket_path": "~/.ssh/167861612428743", "user": "%s", "host": "%s", "remote_shell": "%s"}} $_user $_hostname ${SHELL##*/} | command od -An -v -tx1 | command tr -d \n) printf %
Filing this as a Warp bug because I tried in iTerm2 and it works just fine.
To Reproduce
NA
Expected behaviour
NA
Screenshots
https://app.warp.dev/block/h9m1pXZDgQgonjjworqgfZ
Operating System
MacOS
OS Version
12.5.1
Shell Version
zsh 5.8.1 (x86_64-apple-darwin21.0)
Warp Version
0.2023.03.07.08.02.stable_01
Additional context
No response
Does this block you from using Warp daily?
No
Warp Internal (ignore): linear-label:b8107fdf-ba31-488d-b103-d271c89cac3e
None
Thanks for letting us know @wuhhh. I'll bring this up with the team and we'll post any updates on this thread.
Please :+1: and comment if you're also seeing this issue as it helps us gauge impact.
Can confirm I'm having the same issues as above and getting the same errors when trying to call any ssh command. Falling back to iTerm and SSH works as expected.
For now I've disabled the SSH wrapper as per comment on issue here https://github.com/warpdotdev/Warp/issues/2836#issuecomment-1487243462
I think it would be great if we could disable the wrapper for certain hosts. I've got an older network switch (ICX6450) and the wrapper has never worked with that device from what I recall. I just get:
$ ssh admin@iceblock
Received disconnect from 10.10.20.2 port 22:2: Bad string Length
But for now I just do this to disable the wrapper for this one session:
WARP_USE_SSH_WRAPPER=0 && ssh admin@iceblock
But I rarely access this device, so I end up having to re-learn the env var every time I do need to get in there.
Having the sam issue with WPEngine hosting. Having to rely on another terminal app to interact with it.
@ammmze as an alternative workaround, you can prefix your ssh command with command e.g. command ssh <user@host> to circumvent the SSH wrapper
Still happens, and only on WP Engine, works fine for Kinsta. Will there be some official solution for this?
Same here, still happening for WP Engine...
@zachbai's solution worked for me with WP Engine.
Same here specifically for WPEngine
(Copied here from other closed thread)
I just encountered this problem when using ssh to remotely execute a bash script on a wpengine site.
From testing the issue, it appears that wpengine is changing all whitespace characters in the ssh command string into spaces.
As a result wpengine bash is interpreting multi-line bash scripts as a single line, resulting in bash syntax errors.
@ammmze as an alternative workaround, you can prefix your
sshcommand withcommande.g.command ssh <user@host>to circumvent the SSH wrapper
Lifesaver, thank you!
Hi, having the same issue here.
Same as @ammmze, when I try to access my Brocade ICX6450 :
Received disconnect from 192.168.10.254 port 22:2: Bad string Length
It's an old device, latest firmware, SSH can't be upgraded on it.
I have to put that in my ~/.ssh/config file in the first place for it to work with SSH in macOS Terminal :
Host 192.168.10.254
HostKeyAlgorithms +ssh-rsa
PubkeyAcceptedAlgorithms=+ssh-rsa
KexAlgorithms +diffie-hellman-group1-sha1
Did some diggiing, and maybe found something, at least for my case :
Running a nmap --script ssh2-enum-algos -sV -p 22 192.168.10.254 outputs :
Nmap scan report for 192.168.10.254
Host is up (0.0026s latency).
PORT STATE SERVICE VERSION
22/tcp open ssh AllegroSoft RomSShell sshd 5.40 (protocol 2.0)
| ssh2-enum-algos:
| kex_algorithms: (1)
| diffie-hellman-group1-sha1
| server_host_key_algorithms: (1)
| ssh-rsa
| encryption_algorithms: (7)
| aes256-cbc
| aes192-cbc
| aes128-cbc
| aes256-ctr
| aes192-ctr
| aes128-ctr
| 3des-cbc
| mac_algorithms: (1)
| hmac-sha1
| compression_algorithms: (1)
|_ none
And when searching for this AllegroSoft RomSShell, I found this : https://www.chiark.greenend.org.uk/~sgtatham/putty/wishlist/ssh2-romsshell-badstringlen.html
Hope it helps.
Got same problem when I use ssh to login in my Jump Server.
SSH command could work properly on iTerm2 and MacOS default terminal but lost connection on Warp. I checked ssh -vvv logs and finded out it is caused by SSH wrapper and when I close this feature, it works.