warpdotdev / Warp

Warp is a modern, Rust-based terminal with AI built in so you and your team can build great software, faster.
https://warp.dev
Other
21.4k stars 375 forks source link

SSH to IBM iSeries fails with bsh: syntax error at line 2: `hook=$' unexpected #1598

Open Depicus opened 2 years ago

Depicus commented 2 years ago

Discord username (optional)

No response

Local Shell and Version

5.8.1

Remote Shell and Version

N/A

Operating System and Version

MacOS 12.4

Warp Version

v0.2022.07.04.09.08.stable_02

I have tried commenting out my system & user rcfiles and warp still will not bootstrap

Screenshots

ssh xxxxx@10.xx.xx.xx bsh: syntax error at line 2: `hook=$' unexpected Connection to 10.xx.xx.xx closed.

Include shell xtrace output

bsh: syntax error at line 2: `hook=$' unexpected Connection to 10.xx.xx.xx closed.

Warp Internal (ignore) - linear-label:018de222-5d69-45e6-ba7c-c94b9ae09495

No response

alexmngn commented 2 years ago

I'm having a similar issue while ssh to a CircleCI macOS instance.

ssh -p 12345 11.11.187.154
Error: exec: "hook=$(printf": executable file not found in $PATH
Connection to 11.11.187.154 closed.
Depicus commented 2 years ago

Some more debug info


debug1: Reading configuration data /Users/xxx/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 21: include /etc/ssh/ssh_config.d/* matched no files
debug1: /etc/ssh/ssh_config line 54: Applying options for *
debug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling
debug1: Connecting to xxx [xxx] port 22.
debug1: Connection established.
debug1: identity file /Users/xxx/.ssh/id_rsa type 0
debug1: identity file /Users/xxx/.ssh/id_rsa-cert type -1
debug1: identity file /Users/xxx/.ssh/id_dsa type -1
---cut---
debug1: Local version string SSH-2.0-OpenSSH_8.6
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.0
debug1: compat_banner: match: OpenSSH_8.0 pat OpenSSH* compat 0x04000000
debug1: Authenticating to xxx:22 as 'xxx'
debug1: load_hostkeys: fopen /Users/xxx/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ssh-ed25519
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: SSH2_MSG_KEX_ECDH_REPLY received
debug1: Server host key: ssh-edxxx
debug1: load_hostkeys: fopen /Users/xxx/.ssh/known_hosts2: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts: No such file or directory
debug1: load_hostkeys: fopen /etc/ssh/ssh_known_hosts2: No such file or directory
debug1: Host 'xxx' is known and matches the ED25519 host key.
debug1: Found key in /Users/xxx/.ssh/known_hosts:130
debug1: rekey out after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey in after 134217728 blocks
debug1: Will attempt key: /Users/xxx/.ssh/id_rsa RSA SHA256:xxx
---cut---
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug1: Next authentication method: publickey
debug1: Offering public key: /Users/brian/.ssh/id_rsa RSA SHA256:xxx
debug1: Server accepts key: /Users/brian/.ssh/id_rsa RSA SHA256:xxx
debug1: Authentication succeeded (publickey).
Authenticated to xxx ([xxx]:22).
debug1: setting up multiplex master socket
debug1: channel 0: new [/Users/xxx/.ssh/xxx]
debug1: channel 1: new [client-session]
debug1: Entering interactive session.
debug1: pledge: id
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: client_input_hostkeys: searching /Users/xxx/.ssh/known_hosts for xxx / (none)
debug1: client_input_hostkeys: searching /Users/xxx/.ssh/known_hosts2 for xxx / (none)
debug1: client_input_hostkeys: hostkeys file /Users/xxx/.ssh/known_hosts2 does not exist
debug1: client_input_hostkeys: no new or deprecated keys from server
debug1: Remote: /HOME/xxx/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Remote: /HOME/xxx/.ssh/authorized_keys:2: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding
debug1: Sending environment.
debug1: channel 1: setting env LC_ALL = "en_GB.UTF-8"
debug1: Sending command:
                         hook=$(printf "{\\"hook\\": \\"SSH\\", \\"value\\": {\\"socket_path\\": \\"~/.ssh/xxx\\", \\"user\\": \\"%s\\", \\"machine\\": \\"%s\\", \\"remote_shell\\": \\"%s\\"}}" $(whoami) $(hostname) ${SHELL##*/} | command od -An -v -tx1 | command tr -d " \\n")
                                              printf '\033P$d%s\234' $hook
                                                                          if test "${SHELL##*/}" != "bash" -a "${SHELL##*/}" != "zsh"; then
                    exec $SHELL
                               fi

                                 case ${SHELL##*/} in
                                                       bash) exec -a bash bash --rcfile <(echo 'set -o vi; set +o vi; HISTCONTROL=ignorespace; printf '\\''\033P$xxx\234'\\''') -x
                                      ;;
                                          zsh) WARP_TMP_DIR=$(mktemp -d warptmp.XXXXXX)
                                                                                       if [[ $? == 0 ]]; then
                                                                                                             echo 'xxx
bsh: syntax error at line 2: `hook=$' unexpected
debug1: client_input_channel_req: channel 1 rtype exit-status reply 0
debug1: client_input_channel_req: channel 1 rtype eow@openssh.com reply 0
debug1: channel 1: free: client-session, nchannels 2
debug1: channel 0: free: /Users/xxx/.ssh/xxx, nchannels 1
Connection to xxx closed.
Transferred: sent 4792, received 3212 bytes, in 0.4 seconds
Bytes per second: sent 13505.5, received 9052.5
debug1: Exit status 2```
niktek commented 2 years ago

Same error SSH'ing to Windows 11 Pro.

elviskahoro commented 2 years ago

Thanks for opening!