DockerSbxProvider.open_gateway_tunnel (#57) calls asyncssh.connect with username=, but asyncssh also looks up the local user name. The gateway container runs as a uid with no passwd entry (for example user: 1000:1000, to reach the sbx socket), and USER is not set. The lookup fails, and the gateway closes the whole client connection:
Accepted direct TCP connection request to 127.0.0.1, port 43123
[chan=0] Closing channel due to connection close
[chan=0] Channel closed: Unknown local username: set one of LOGNAME, USER, LNAME, or USERNAME in the environment
The error is not a ProviderError, so connection_requested does not turn it into a ChannelOpenError. The client loses the connection, and every later command on it fails with ChannelOpenError: SSH connection closed.
Reproduce
Run the gateway as a uid with no passwd entry and no USER. Open a direct-tcpip channel to 127.0.0.1 on a docker-sbx host.
Expected
open_gateway_tunnel passes local_username, so it does not depend on the environment.
- A tunnel failure of any type closes only the channel, not the client connection.
DockerSbxProvider.open_gateway_tunnel(#57) callsasyncssh.connectwithusername=, but asyncssh also looks up the local user name. The gateway container runs as a uid with no passwd entry (for exampleuser: 1000:1000, to reach the sbx socket), andUSERis not set. The lookup fails, and the gateway closes the whole client connection:The error is not a
ProviderError, soconnection_requesteddoes not turn it into aChannelOpenError. The client loses the connection, and every later command on it fails withChannelOpenError: SSH connection closed.Reproduce
Run the gateway as a uid with no passwd entry and no
USER. Open adirect-tcpipchannel to127.0.0.1on a docker-sbx host.Expected
open_gateway_tunnelpasseslocal_username, so it does not depend on the environment.