Pengwin
Pengwin copied to clipboard
Using fish shell breaks ssh ProxyJump
Describe the bug
When fish
is installed and configured as the default shell, ProxyJump
in SSH does not work, that is, ssh -J user@jumphost user@destination host
fails.
SSH [to the jump host] without ProxyJump
works, and if the user's [default] shell is, e.g. bash
, then ProxyJump
also works.
To Reproduce Steps to reproduce the behavior:
- Install fish shell using
pengwin-setup
, setting the default shell tofish
- Attempt to SSH to a host via an intermediary host using
ProxyJump
(-J
):
user@mypc:~$ echo $SHELL
/usr/bin/fish
user@mypc:~$ ssh -J user@jumphost remoteuser@destinationhost
Bad packet length 1349676916.
ssh_dispatch_run_fatal: Connection to UNKNOWN port 65535: message authentication code incorrect
user@mypc:~$
- Note the error 'Bad packet length
. Using
ssh -vvvshows this happens at the
SSH2_MSG_KEXINIT sent` step for the destination host.
Expected behavior The SSH command should succeed regardless of the user's shell.
Additional context
The error is related to output in the shell initialisation script, see e.g. eval in config.fish breaks ssh proxy command.
In particular, /etc/fish/conf.d/00-pengwin.fish
seems to be the culprit (see additional troubleshooting below).
Basic Troubleshooting Checklist
[X] I have searched Google for the error message.
[X] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled.
[X] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues.
[X] I have searched the Pengwin issues page: https://github.com/WhitewaterFoundry/Pengwin/issues.
[ ] I have run Windows 10 updates and restarted.
[X] I have restarted WSL service: wsl.exe --terminate WLinux
wsl.exe --shutdown
.
What other troubleshooting have you attempted?
- Change the user's shell to
bash
(by setting theSHELL
environment variable, but could also do viachsh
and logging in and out):
user@mypc:~$ set -x SHELL "/bin/bash"
- Try the SSH again, observe that it works:
user@mypc:~$ echo $SHELL
/bin/bash
user@mypc:~$ ssh -J user@jumphost remoteuser@destinationhost
remoteuser@destinationhost's password:
remoteuser@destinationhost:~$
- Delete or otherwise disable the shell initialisation script that causes the issue:
user@mypc:~$ sudo mv /etc/fish/conf.d/00-pengwin.fish /etc/fish/conf.d/00-pengwin.fish.bak
- Change the user's shell back to
fish
:
user@mypc:~$ set -x SHELL "/usr/bin/fish"
- Try the SSH command again, observe that it works:
user@mypc:~$ echo $SHELL
/usr/bin/fish
user@mypc:~$ ssh -J user@jumphost remoteuser@destinationhost
remoteuser@destinationhost's password:
remoteuser@destinationhost:~$
Pengwin Version
21.9.0
WSL general info
WSL Version: 2
Locale: en_GB
Release Install Date: Tue Jun 29 19:10:56 BST 2021
Branch: co_release
Build: 22000
Full Build: 22000.1.amd64fre.co_release.210604-1628
Display Scaling: 1.25
Windows Theme: light
Windows Uptime: 0d 4h 6m
WSL Uptime: 0d 3h 21m
WSL Release: Pengwin
WSL Kernel: Linux 5.10.43.3-microsoft-standard-WSL2
Packages Count: 1599
Further troubleshooting
The patch in WhitewaterFoundry/pengwin-base#119 fixes this by skipping the offending line in 00-pengwin.fish
for non-login shells (which is the case for the ProxyJump step).
Thank you for your contribution. I'll take the time to read the description and do some tests thoroughly.