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

Using fish shell breaks ssh ProxyJump #712

Open
imgrant opened this issue Sep 29, 2021 · 2 comments · Fixed by WhitewaterFoundry/pengwin-base#119
Open

Using fish shell breaks ssh ProxyJump #712

imgrant opened this issue Sep 29, 2021 · 2 comments · Fixed by WhitewaterFoundry/pengwin-base#119
Assignees
Labels
Bug This is a problem. Patched This has been fixed.

Comments

@imgrant
Copy link

imgrant commented Sep 29, 2021

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:

  1. Install fish shell using pengwin-setup, setting the default shell to fish
  2. 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:~$
  1. Note the error 'Bad packet length. Using ssh -vvvshows this happens at theSSH2_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?

  1. Change the user's shell to bash (by setting the SHELL environment variable, but could also do via chsh and logging in and out):
user@mypc:~$ set -x SHELL "/bin/bash"
  1. 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:~$
  1. 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
  1. Change the user's shell back to fish:
user@mypc:~$ set -x SHELL "/usr/bin/fish"
  1. 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
@imgrant
Copy link
Author

imgrant commented Sep 29, 2021

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).

@crramirez crramirez added the Patched This has been fixed. label Sep 29, 2021
@crramirez crramirez self-assigned this Sep 29, 2021
@crramirez
Copy link
Collaborator

Thank you for your contribution. I'll take the time to read the description and do some tests thoroughly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a problem. Patched This has been fixed.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants