question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

ProxyCommand none breaks connection

See original GitHub issue

According to man ssh_config, setting ProxyCommand none should disable the option entirely.

asyncssh interprets none as the command to execute as proxy command, thus returning the following error:

File "asyncssh/asyncssh/connection.py", line 434, in _connect
  conn = await _open_proxy(loop, proxy_command, conn_factory)
File "asyncssh/asyncssh/connection.py", line 352, in _open_proxy
  _, tunnel = await loop.subprocess_exec(_ProxyCommandTunnel, *command)
File "/usr/lib/python3.10/asyncio/base_events.py", line 1670, in subprocess_exec
  transport = await self._make_subprocess_transport(
File "/usr/lib/python3.10/asyncio/unix_events.py", line 207, in _make_subprocess_transport
  transp = _UnixSubprocessTransport(self, protocol, args, shell,
File "/usr/lib/python3.10/asyncio/base_subprocess.py", line 36, in __init__
  self._start(args=args, shell=shell, stdin=stdin, stdout=stdout,
File "/usr/lib/python3.10/asyncio/unix_events.py", line 800, in _start
  self._proc = subprocess.Popen(
File "/usr/lib/python3.10/subprocess.py", line 971, in __init__
  self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1847, in _execute_child
  raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'none'

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ronfcommented, Dec 17, 2022

Thanks very much - the fix for this is now available in the “develop” branch as commit https://github.com/ronf/asyncssh/commit/aaf7d2910993a87d059bddcbf04c42df3d017ca9 and will be included in the next release.

1reaction
dtrifirocommented, Dec 16, 2022

Hi @ronf,

thanks for the suggestions. I agree that would be cleaner, I updated the PR accordingly.

As for the use case: I’m assuming having ProxyCommand none is useful for cases in which you need a proxy to access all resources but a few internal ones, something like this:

    
Host <internal host>
    ProxyCommand none
    
Host *
    ProxyCommand <proxy command>

edit: swapped ordering, leaving the more generic option last

Read more comments on GitHub >

github_iconTop Results From Across the Web

Use ProxyCommand for all SSH Connections - Super User
The example above will make it recursive, that every connection will use a proxy command, which is again ssh with another proxy command....
Read more >
Problems with SSH ProxyCommand [closed]
The ProxyCommand option in ssh expects to STDIN & STDOUT of the command to be connected directly to the destination host ( %h...
Read more >
SSH ProxyCommand example: Going through one host to ...
Explains going through one host to reach another using SSH ProxyCommand on a Linux or Unix with example about ssh to connect to...
Read more >
Can't use a ProxyCommand-based SSH connection #285
If you need ProxyCommand to connect a host but it can be reached from the internet ... So, your proposed fix breaks a...
Read more >
SSH ProxyCommand - Status-Q
Great! Small improvement: add “-e none” That makes the first ssh connection fully transparent so it won't break on control sequences. i.e. “ ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found