Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSH workaround won't work if target is using fish shell #3277

Closed
crispyricepc opened this issue Jan 30, 2021 · 2 comments
Closed

SSH workaround won't work if target is using fish shell #3277

crispyricepc opened this issue Jan 30, 2021 · 2 comments
Labels

Comments

@crispyricepc
Copy link

Describe the bug
When using the kitty +kitten ssh <target> workaround for SSH using kitty, if the target host is using the fish shell, the following error is produced:

fish: Unsupported use of '='. In fish, please use 'set tmp $(mktemp)'.

I believe this is due to a shell script being executed at this line being interpreted by the host's default shell, rather than /bin/sh as it appears to be intended

To Reproduce
Steps to reproduce the behaviour:

  1. Set the host shell to fish, using chsh <user> -s /usr/bin/fish
  2. Run kitty +kitten ssh <user>@<hostname>

Expected behavior
SSH succeeds

Code Output
I've added the -v flag here to show why I think this is happening:

$ kitty +kitten ssh desktop -v
OpenSSH_8.3p1 Ubuntu-1, OpenSSL 1.1.1f  31 Mar 2020
debug1: Reading configuration data /home/benjo/.ssh/config
[REDACTED FOR ANTIDOX REASONS]
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: include /etc/ssh/ssh_config.d/*.conf matched no files
debug1: /etc/ssh/ssh_config line 21: Applying options for *
debug1: Connecting to 192.168.0.97 [192.168.0.97] port 4921.
debug1: Connection established.
[REDACTED FOR ANTIDOX REASONS (private keys)]
debug1: Local version string SSH-2.0-OpenSSH_8.3p1 Ubuntu-1
debug1: Remote protocol version 2.0, remote software version OpenSSH_8.4
debug1: match: OpenSSH_8.4 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.0.97:4921 as 'benjo'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
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: Server host key: ecdsa-sha2-nistp256 SHA256:m//KWBcuRvOCueBHYClNOgTO7NTNHO8UPg7oFlRynd4
debug1: Host '[192.168.0.97]:4921' is known and matches the ECDSA host key.
debug1: Found key in /home/benjo/.ssh/known_hosts:3
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
[REDACTED FOR ANTIDOX REASONS (private keys)]
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<ssh-ed25519,sk-ssh-ed25519@openssh.com,ssh-rsa,rsa-sha2-256,rsa-sha2-512,ssh-dss,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ecdsa-sha2-nistp256@openssh.com,webauthn-sk-ecdsa-sha2-nistp256@openssh.com>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
[REDACTED FOR ANTIDOX REASONS (private keys)]
debug1: Next authentication method: password
benjo@192.168.0.97's password: 
debug1: Authentication succeeded (password).
Authenticated to 192.168.0.97 ([192.168.0.97]:4921).
debug1: channel 0: new [client-session]
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: pledge: network
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Sending environment.
debug1: Sending env LANG = en_GB.UTF-8
debug1: Sending command: #!/bin/sh
                                  # macOS ships with an ancient version of tic that cannot read from stdin, so we
                                                                                                                 # create a temp file for it
                                                                                                                                            tmp=$(mktemp)
                                                                                                                                                         cat >$tmp << 'TERMEOF'
                                                                                                                                                                               #	Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-kitty
                                            xterm-kitty|KovIdTTY,
                                                                 	am, ccc, hs, km, mc5i, mir, msgr, npc, xenl,
                                                                                                                    	colors#0x100, cols#80, it#8, lines#24, pairs#0x7fff,
                                                                                                                                                                            	acsc=++\\,\\,--..00``aaffgghhiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
                                        	bel=^G, bold=\\E[1m, cbt=\\E[Z, civis=\\E[?25l,
                                                                                               	clear=\\E[H\\E[2J, cnorm=\\E[?12l\\E[?25h, cr=\\r,
                                                                                                                                                  	csr=\\E[%i%p1%d;%p2%dr, cub=\\E[%p1%dD, cub1=^H,
                                                                                                                                                                                                        	cud=\\E[%p1%dB, cud1=\\n, cuf=\\E[%p1%dC, cuf1=\\E[C,
                                                   	cup=\\E[%i%p1%d;%p2%dH, cuu=\\E[%p1%dA, cuu1=\\E[A,
                                                                                                           	cvvis=\\E[?12;25h, dch=\\E[%p1%dP, dch1=\\E[P, dim=\\E[2m,
                                                                                                                                                                          	dl=\\E[%p1%dM, dl1=\\E[M, dsl=\\E]2;\\007, ech=\\E[%p1%dX,
                        	ed=\\E[J, el=\\E[K, el1=\\E[1K, flash=\\E[?5h$<100/>\\E[?5l,
                                                                                            	fsl=^G, home=\\E[H, hpa=\\E[%i%p1%dG, ht=^I, hts=\\EH,
                                                                                                                                                      	ich=\\E[%p1%d
[REDACTED FOR ANTIDOX REASONS (an annoying welcome message)]

fish: Unsupported use of '='. In fish, please use 'set tmp $(mktemp)'.

debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
debug1: channel 0: free: client-session, nchannels 1
Connection to 192.168.0.97 closed.
Transferred: sent 5984, received 4300 bytes, in 0.0 seconds
Bytes per second: sent 127829.0, received 91855.8
debug1: Exit status 0

The meat of this debug message is the sending command line, which shows that the command is being sent to be interpreted by the shell

Environment details
Client Host: Ubuntu 20.10, GNOME Desktop Environment, Kitty version 0.18.3
Target Host: Arch Linux (Kernel LTS 5.4)

Kitty debug output

kitty 0.18.3 created by Kovid Goyal
Linux Ben-Laptop 5.8.0-41-generic #46-Ubuntu SMP Mon Jan 18 16:48:44 UTC 2021 x86_64
Ubuntu 20.10 \n \l
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.10
DISTRIB_CODENAME=groovy
DISTRIB_DESCRIPTION="Ubuntu 20.10"
Loaded config files: /etc/xdg/kitty/kitty.conf, /home/benjo/.config/kitty/kitty.conf
Running under: X11

Config options different from defaults:
background            Color(red=46, green=52, blue=64)
color0                Color(red=59, green=66, blue=82)
color1                Color(red=191, green=97, blue=106)
color10               Color(red=163, green=190, blue=140)
color11               Color(red=235, green=203, blue=139)
color12               Color(red=129, green=161, blue=193)
color13               Color(red=180, green=142, blue=173)
color14               Color(red=143, green=188, blue=187)
color15               Color(red=236, green=239, blue=244)
color2                Color(red=163, green=190, blue=140)
color3                Color(red=235, green=203, blue=139)
color4                Color(red=129, green=161, blue=193)
color5                Color(red=180, green=142, blue=173)
color6                Color(red=136, green=192, blue=208)
color7                Color(red=229, green=233, blue=240)
color8                Color(red=76, green=86, blue=106)
color9                Color(red=191, green=97, blue=106)
cursor                Color(red=129, green=161, blue=193)
font_family           JetBrains Mono
foreground            Color(red=216, green=222, blue=233)
update_check_interval 0.0
window_margin_width   FloatEdges(left=10.0, top=10.0, right=10.0, bottom=10.0)

Additional context
This is not really an issue with the kitty client itself, just with how it handles ssh. It should have the same problem regardless of kitty config

@kovidgoyal
Copy link
Owner

Yes, that is noted in teh FAQ entry for it. If you dont use a POSIX
compliant shell, you will need to copy it manually.

@kovidgoyal
Copy link
Owner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants