You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a few hosts I connect to regularly through ssh that use the ProxyJump configuration, set up through ~/.ssh/config. It seems that any attempt to connect through them when nushell has been setup as a login shell will fail with the following error. Any other ssh connection of the ones I use regularly seem to work fine. Trying to connect to the same host through ssh through another shell, as nushell has been set to login, will also fail.
(HOST, PORT, and DESTINATION are obfuscated placeholders)
Error: nu::parser::unknown_flag (link)
× The`exec` command doesn't have flag `-W`.
╭─[source:1:1]
1 │ exec ssh -W '[HOST]:PORT' DESTINATION
· ┬
· ╰── unknown flag
╰────
help: use exec --helpfor a list of flags
How to reproduce
Set nushell as your login shell.
Use ssh's ProxyJump configuration option in ~/.ssh/config or directly as a CLI argument with -W.
Expected behavior
Nushell should allow you to ssh to the destination.
And if it's set through a config option in .ssh/config? I use ProxyJump in tandem with an open ssh connection from a server behind a firewall where port 22 is not open, to a fully accessible server. This way I can connect to the locked-down server with my local ssh keys through the available server.
ssh command given: ssh closed
sample ssh config:
Host open
HostName <DOMAIN>
User <USER>
Host closed
ProxyJump open
HostName localhost
Port <PORT>
User <USERNAME>
If there is no way to set the -W flag as "-W" you're likely out of luck. One thing you could try is hide exec before you call ssh.
We need to realize the fall-through signatures to make exec usable, this is a prime use case for them. Removing exec until we have fall-through signatures might be a good idea.
Reacted by savoy, Arthur Woimbée and Darren Schroeder
This issue is making ssh unusable with a ~/.ssh/config, as our ssh configs at work must proxy jump through a bastion host, and with a ~/.ssh/config, you don't have control over the args. It's a hard blocker for using nushell as a daily driver.
Activity
kubouch commentedon Aug 22, 2022
You need to wrap the -W in quotes, otherwise Nushell thinks it's a flag for
exec.ElDifinitivo commentedon Aug 22, 2022
And if it's set through a config option in
.ssh/config? I useProxyJumpin tandem with an open ssh connection from a server behind a firewall where port 22 is not open, to a fully accessible server. This way I can connect to the locked-down server with my local ssh keys through the available server.ssh command given:
ssh closedsample ssh config:
fdncred commentedon Aug 22, 2022
maybe we should remove our exec command. it seems like it causes a bunch of confusion/trouble.
kubouch commentedon Aug 22, 2022
If there is no way to set the
-Wflag as"-W"you're likely out of luck. One thing you could try ishide execbefore you call ssh.We need to realize the fall-through signatures to make
execusable, this is a prime use case for them. Removingexecuntil we have fall-through signatures might be a good idea.dead10ck commentedon Nov 17, 2022
This issue is making ssh unusable with a
~/.ssh/config, as our ssh configs at work must proxy jump through a bastion host, and with a~/.ssh/config, you don't have control over the args. It's a hard blocker for using nushell as a daily driver.fdncred commentedon Nov 17, 2022
@dead10ck did you try
hide execfrom within nushell? I believe this would force nushell to use the OS's exec instead of nushell's version.dead10ck commentedon Nov 18, 2022
@fdncred yes, I tried that, and it still fails with the same error.
dzintars commentedon Nov 22, 2022
You can use
Instead of using
ProxyJumpyou can use explicitProxyCommand.But I still see this as a workaround, not an solution.
#2675
dead10ck commentedon Nov 22, 2022
@dzintars yes, I got this tip in Discord thanks to @fdncred; it's what I've been doing until this is resolved.
dandavison commentedon Dec 14, 2022
I have this problem at work also --
ssh -Wused in.ssh/configand scripts that I don't want to alter. Here's a silly hack that seems to work (adds all single-letter flags toexecand passes them on): https://github.com/dandavison/nushell/pull/17/filesThat's obviously not the real solution. Maybe
execshould be a special case in the parser?fdncred commentedon Dec 22, 2022
closing as fixed by #7527. please re-open if it's not fixed.