Genymobile / scrcpy

Display and control your Android device
Apache License 2.0
113.55k stars 10.82k forks source link

Ssh tunnel not works #5254

Open toto6976 opened 3 months ago

toto6976 commented 3 months ago

Good morning, I cannot connect to my smartphone when I am outside my home. I read the doc on 'ssh tunnel' but it doesn't work. I suppose i don't understand. Can you tell me what to do ?: the commands I pass must be wrong.

My smartphone is identified on the local network at 192.168.1.14 I have an ssh server open on 192.168.1.72. The PC with which I want to access the smartphone is in 192.168.0.251 in a other town. I open dyndns adresse on livebox to my ssh serveur.

rom1v commented 3 months ago

First, independently of scrcpy, can you access your remote computer (on which the remote device is connected) from your local computer using ssh?

toto6976 commented 3 months ago

Yes i can access the remote computer from my local computer via ssh. Remote house : pc with ssh server, smartphone. Local house : pc with ssh client.

And scrcpy works in the remote house from pc (witch one having the ssh server) to smartphone.

rom1v commented 3 months ago

OK, the describe what you did and what errors you got. Only use IP for know (don't use DNS to avoid additional possible issues).

toto6976 commented 3 months ago

I am trying to understand how the ssh tunnel works

# local  5038 --> remote  5037
# local 27183 <-- remote 27183
ssh -CN -L5038:localhost:5037 -R27183:localhost:27183 your_remote_computer

1/ i don't understand the ports. 2/ in my situation, what is remote computer and the localhost.

From thé pc 192.168.0.251 I tried ssh -CN -L5038:192.168.0.251:5037 -R27183:192.168.0.251:27183 mysshserveur@dyndns.net pxxxx

hostname contains iinvalid characters

rom1v commented 3 months ago

1/ i don't understand the ports.

5037 is the port adb is listening on on your remote computer If you create a local port redirection (-L5038:localhost:5037), this means that accessing your local port 5038 will redirect you to localhost:5037 from the other end of the tunnel (so on your remote computer). In other words, from your local computer, localhost:5038 is your_remote_computer:5037.

2/ in my situation, what is remote computer and the localhost.

My smartphone is identified on the local network at 192.168.1.14 I have an ssh server open on 192.168.1.72.

What is the public address IP if your ssh server (as viewed from your client computer, 192.168.1.72 is the local address, not the public one)? That IP is your_remote_computer.

localhost is localhost, nothing to change.

toto6976 commented 3 months ago

Hi 192.168.1.72 is the local ip adress of my pc on wich my ssh server is located. Of course it have an ip public : 65.xx.xxx.yyy. Is this PC the remote PC ? Is 192.168.0.251 the localhost ip ? I think i don't really understand port redirection. So i keep 5037. Then here is the new code ssh -CN -L5037:192.168.0.251:5037 -R27183:192.168.0.251:27183 65.xx.xxx.yyy pxxxx Is it OK ?

toto6976 commented 3 months ago

5037 is the port adb is listening on on your remote computer

So the 'remote computer' is the one witch the ssh server is installed. It means on the same LAN as the smartphone ?

rom1v commented 3 months ago

Your server: 65.xx.xxx.yyy (machine with local ip: 192.168.1.72). Your client: localhost (machine with the local ip: 192.168.0.251).

I assume both computers are on Linux.

From the client, execute:

ssh -CN -L5038:localhost:5037 -R27183:localhost:27183 65.xx.xxx.yyy
# keep this open

From another terminal on the client:

export ADB_SERVER_SOCKET=tcp:localhost:5038
scrcpy

I think i don't really understand port redirection. So i keep 5037.

One problem is that if your local computer also has an adb server running, 5037 is already used locally.

ssh -CN -L5037:192.168.0.251:5037 -R27183:192.168.0.251:27183 65.xx.xxx.yyy pxxxx Is it OK ?

No, you must keep localhost. The remote direction will not work on another interface by default.

And what is your pxxxx? If your ssh server listens on a port different of the default one (22), you can pass an option -pxxxx (the - is missing, probably a typo in your comment).

toto6976 commented 3 months ago

Yes , it's -pxxxx sorry.

One problem is that if your local computer also has an adb server running, 5037 is already used locally.

On the localhost computer (192.168.0.251) ? So an 'adb kill-server is OK ?

toto6976 commented 3 months ago

One problem is that if your local computer also has an adb server running, 5037 is already used locally.

'Local computer' it means localhost computer (192.168.0.251) ?

rom1v commented 3 months ago

Yes, the client.

("localhost computer" is confusing, since every computer is localhost/127.0.0.1)

toto6976 commented 3 months ago

From another terminal on the client:

export ADB_SERVER_SOCKET=tcp:localhost:5038
scrcpy

I write "scrcpy" or "scrcpy --tcpip 192.168.1.14:5555 ?

toto6976 commented 3 months ago

OK i think i understand.

A last question : can i keep the smartphone screen off ? What should i add to the command line you gave me ?

rom1v commented 3 months ago

I write "scrcpy" or "scrcpy --tcpip 192.168.1.14:5555 ?

As you like (it depends if it is connected over USB or not). From the client, you can use adb devices to list the remote devices (and adb connect, etc. as usual).

can i keep the smartphone screen off ?

Yes: scrcpy --turn-screen-off.

toto6976 commented 3 months ago

It is not connected over usb. So i write scrcpy --tcpip 192.168.1.14:5555 ?

toto6976 commented 3 months ago

as I am not in the house today where the smartphone is located, will it ask me to associate the 'localhost' PC or everything happens as if I am using the PC (remote) with which I am using it? had associated?

rom1v commented 3 months ago

So i write scrcpy --tcpip 192.168.1.14:5555 ?

Yes. From a terminal where ADB_SERVER_SOCKET is correctly defined:

export ADB_SERVER_SOCKET=tcp:localhost:5038
toto6976 commented 3 months ago

OK. I trie today.

toto6976 commented 3 months ago

Everything is ok.

I tried with the dyndns adress and it seams ok too.

can we use scrcpy on 4G if the wifi connection cuts out for one reason or another?

Le lun. 2 sept. 2024 à 09:40, Romain Vimont @.***> a écrit :

Yes. From a terminal where ADB_SERVER_SOCKET is correctly defined:

export ADB_SERVER_SOCKET=tcp:localhost:5038

— Reply to this email directly, view it on GitHub https://github.com/Genymobile/scrcpy/issues/5254#issuecomment-2324032065, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMWAAOQ7H5AXUQM6Z4KN47LZUQJABAVCNFSM6AAAAABNO4K626VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGMRUGAZTEMBWGU . You are receiving this because you authored the thread.Message ID: @.***>

toto6976 commented 2 months ago

Hi, This morning, i can't connect adb !! adb: failed to check server version: protocol fault (couldn't read status): Connection reset by peer

channel 2: open failed: connect failed: Connection refused

toto6976 commented 2 months ago

I start adb on the ssh server. Everything is ok ! Why ???!

rom1v commented 2 months ago

I start adb on the ssh server.

Because your client adb connects to the adb daemon, which normally runs on the same machine, but here it runs on the remote machine (and the client and daemon connects through the ssh tunnel).

In other words, when you run adb devices, normally, your process connects to the ssh daemon (listening on localhost:5037 by default). But here, you specified to connect to localhost:5038, and the local port 5038 is forwarded to the remote port 5037, so your local adb client connects to the remote adb daemon. If the daemon is not running, then there is nothing to connect to.

toto6976 commented 2 months ago

ok. Do I have to reconnect the device via usb? or an adb connect device_ip_address:5555 is enough

rom1v commented 2 months ago

It depends if you rebooted the device. It must be connected over USB at least once after each device reboot to execute (directly or indirectly) adb tcpip 5555.

toto6976 commented 2 months ago

Another thing: I have two devices on two different addresses. They each have a different tcpip port. Device 1 tcpip 5555 Device 2 tcpip 5556 When I change devices, only device 2 requires a usb reconnection to work. The other no?!? I don't know what to do. Device 1 is a normal Samsung, device 2 is an OS 11 lineage.

toto6976 commented 2 months ago

It depends if you rebooted the device. It must be connected over USB at least once after each device reboot to execute (directly or indirectly) adb tcpip 5555.

No, the device is not rebooted

rom1v commented 2 months ago

They each have a different tcpip port

Why do you use different ports? Just use 5555 (the default) for all devices.

When I change devices, only device 2 requires a usb reconnection to work. The other no?!? I don't know what to do.

I'm not sure to understand.

toto6976 commented 2 months ago

I start adb on the ssh server.

Because your client adb connects to the adb daemon, which normally runs on the same machine, but here it runs on the remote machine (and the client and daemon connects through the ssh tunnel).

In other words, when you run adb devices, normally, your process connects to the ssh daemon (listening on localhost:5037 by default). But here, you specified to connect to localhost:5038, and the local port 5038 is forwarded to the remote port 5037, so your local adb client connects to the remote adb daemon. If the daemon is not running, then there is nothing to connect to.

ok. It's not practical at all but hey...Isn't there a way to do it differently?

toto6976 commented 2 months ago

They each have a different tcpip port

Why do you use different ports? Just use 5555 (the default) for all devices.

When I change devices, only device 2 requires a usb reconnection to work. The other no?!? I don't know what to do.

I'm not sure to understand.

https://developer.android.com/tools/adb Each emulator uses a pair of sequential ports — an even-numbered port for console connections and an odd-numbered port for adb connections. For example:

Emulator 1, console: 5554 Emulator 1, adb: 5555 Emulator 2, console: 5556 Emulator 2, adb: 5557 and so on.

rom1v commented 2 months ago

It's not practical at all but hey...Isn't there a way to do it differently?

It's just some hacks to connect to the adb daemon as if it were local (i.e. running on the same machine).

The user-friendly solution would be to add server/client features to scrcpy, which is out-of-scope.

toto6976 commented 2 months ago

ok, so only

adb tcpip 5555 adb connect device_ip_address1:5555 adb connect device_ip_address2:5555

then I can switch from one to the other by simply changing the address: scrcpy --tcpip adresse_ip1:5555 or scrcpy --tcpip adresse_ip2:5555

toto6976 commented 2 months ago

It's not practical at all but hey...Isn't there a way to do it differently?

It's just some hacks to connect to the adb daemon as if it were local (i.e. running on the same machine).

The user-friendly solution would be to add server/client features to scrcpy, which is out-of-scope.

I don't understand absolutely anything! We'll leave it like that for the moment.

kuolemaaa commented 2 months ago

I'm trying to access, via adb and scrcpy, a remote android device and I don't understand why a simple reverse port forwarding of the port 5555 via ssh doesnt work. ( While, when the android dev is in the local network, I can easily connect to it via adb connect android_local_ip:5555 )

I have an exposed-to-internet ssh server at, let's say, ssh_ip:ssh_port and a remote android device on another network. I installed termux on such android device and installed openssh (and other packages) in termux, set up public keys and then launched from the android's termux:

ssh -p ssh_port -N -f -R 5555:127.0.0.1:5555 user@ssh_ip

such that at the ssh server I would run adb connect 127.0.0.1:5555 and reach the android device.

It seems that the tunnel works as intended as I tried with openbsd netcat listening on the termux. But the ssh server cannot establish the adb connection via the forwarded endpoint.

Adding -vv in the ssh commands I can read a bunch repeting lines that starts around line 100-ish

Long Log `ssh -vv -p ssh_port -N -f -R 5555:127.0.0.1:5555 user@ssh_ip` ``` OpenSSH_9.9p1, OpenSSL 3.3.2 3 Sep 2024 debug1: Reading configuration data /data/data/com.termux/files/usr/etc/ssh/ssh_config debug1: /data/data/com.termux/files/usr/etc/ssh/ssh_config line 20: include /data/data/com.termux/files/usr/etc/ssh/ssh_config.d/*.conf matched no filesdebug1: Authenticator provider $SSH_SK_PROVIDER did not resolve; disabling debug2: resolving "SSH_SERVER_IP" port SSH_SERVER_PORT debug1: Connecting to SSH_SERVER_IP [SSH_SERVER_IP] port SSH_SERVER_PORT. debug1: Connection established. debug1: identity file /data/user/0/com.termux/files/home/.ssh/keys/ssh_key type 3 debug1: identity file /data/user/0/com.termux/files/home/.ssh/keys/ssh_key-cert type -1 debug1: Local version string SSH-2.0-OpenSSH_9.9 debug1: Remote protocol version 2.0, remote software version OpenSSH_9.8 debug1: compat_banner: match: OpenSSH_9.8 pat OpenSSH* compat 0x04000000 debug2: fd 3 setting O_NONBLOCK debug1: Authenticating to SSH_SERVER_IP:SSH_SERVER_PORT as 'SSH_USER' debug1: load_hostkeys: fopen /data/data/com.termux/files/home/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /data/data/com.termux/files/usr/etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /data/data/com.termux/files/usr/etc/ssh/ssh_known_hosts2: No such file or directory debug1: SSH2_MSG_KEXINIT sent debug1: SSH2_MSG_KEXINIT received debug2: local client KEXINIT proposal debug2: KEX algorithms: sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com,mlkem768x25519-sha256,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c,kex-strict-c-v00@openssh.com debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: compression ctos: none,zlib@openssh.com debug2: compression stoc: none,zlib@openssh.com debug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug2: peer server KEXINIT proposal debug2: KEX algorithms: sntrup761x25519-sha512@openssh.com,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-s,kex-strict-s-v00@openssh.com debug2: host key algorithms: rsa-sha2-512,rsa-sha2-256,ecdsa-sha2-nistp256,ssh-ed25519 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: compression ctos: none,zlib@openssh.com debug2: compression stoc: none,zlib@openssh.com debug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug1: kex: algorithm: sntrup761x25519-sha512@openssh.com debug1: kex: host key algorithm: ssh-ed25519 debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: compression: none debug1: expecting SSH2_MSG_KEX_ECDH_REPLY debug1: SSH2_MSG_KEX_ECDH_REPLY received debug1: Server host key: ssh-ed25519 SHA256:1dT8yfDidknUptQsPnyq2XrNs16Jsojg8iwHLeMLGsc debug1: load_hostkeys: fopen /data/data/com.termux/files/home/.ssh/known_hosts2: No such file or directory debug1: load_hostkeys: fopen /data/data/com.termux/files/usr/etc/ssh/ssh_known_hosts: No such file or directory debug1: load_hostkeys: fopen /data/data/com.termux/files/usr/etc/ssh/ssh_known_hosts2: No such file or directory debug1: Host '[SSH_SERVER_IP]:SSH_SERVER_PORT' is known and matches the ED25519 host key. debug1: Found key in /data/data/com.termux/files/home/.ssh/known_hosts:1 debug1: ssh_packet_send2_wrapped: resetting send seqnr 3 debug2: ssh_set_newkeys: mode 1 debug1: rekey out after 134217728 blocks debug1: SSH2_MSG_NEWKEYS sent debug1: Sending SSH2_MSG_EXT_INFO debug1: expecting SSH2_MSG_NEWKEYS debug1: ssh_packet_read_poll2: resetting read seqnr 3 debug1: SSH2_MSG_NEWKEYS received debug2: ssh_set_newkeys: mode 0 debug1: rekey in after 134217728 blocks debug2: KEX algorithms: sntrup761x25519-sha512,sntrup761x25519-sha512@openssh.com,mlkem768x25519-sha256,curve25519-sha256,curve25519-sha256@libssh.org,ecdh-sha2-nistp256,ecdh-sha2-nistp384,ecdh-sha2-nistp521,diffie-hellman-group-exchange-sha256,diffie-hellman-group16-sha512,diffie-hellman-group18-sha512,diffie-hellman-group14-sha256,ext-info-c,kex-strict-c-v00@openssh.com debug2: host key algorithms: ssh-ed25519-cert-v01@openssh.com,ecdsa-sha2-nistp256-cert-v01@openssh.com,ecdsa-sha2-nistp384-cert-v01@openssh.com,ecdsa-sha2-nistp521-cert-v01@openssh.com,sk-ssh-ed25519-cert-v01@openssh.com,sk-ecdsa-sha2-nistp256-cert-v01@openssh.com,rsa-sha2-512-cert-v01@openssh.com,rsa-sha2-256-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp256,ecdsa-sha2-nistp384,ecdsa-sha2-nistp521,sk-ssh-ed25519@openssh.com,sk-ecdsa-sha2-nistp256@openssh.com,rsa-sha2-512,rsa-sha2-256 debug2: ciphers ctos: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: ciphers stoc: chacha20-poly1305@openssh.com,aes128-ctr,aes192-ctr,aes256-ctr,aes128-gcm@openssh.com,aes256-gcm@openssh.com debug2: MACs ctos: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: MACs stoc: umac-64-etm@openssh.com,umac-128-etm@openssh.com,hmac-sha2-256-etm@openssh.com,hmac-sha2-512-etm@openssh.com,hmac-sha1-etm@openssh.com,umac-64@openssh.com,umac-128@openssh.com,hmac-sha2-256,hmac-sha2-512,hmac-sha1 debug2: compression ctos: none,zlib@openssh.com debug2: compression stoc: none,zlib@openssh.com debug2: languages ctos: debug2: languages stoc: debug2: first_kex_follows 0 debug2: reserved 0 debug1: SSH2_MSG_EXT_INFO received debug1: kex_ext_info_client_parse: server-sig-algs= debug1: kex_ext_info_check_ver: publickey-hostbound@openssh.com=<0> debug1: kex_ext_info_check_ver: ping@openssh.com=<0> debug2: service_accept: ssh-userauth debug1: SSH2_MSG_SERVICE_ACCEPT received debug1: SSH2_MSG_EXT_INFO received debug1: kex_ext_info_client_parse: server-sig-algs= debug1: Authentications that can continue: publickey debug1: Next authentication method: publickey debug1: Will attempt key: /data/user/0/com.termux/files/home/.ssh/keys/ssh_key ED25519 SHA256:9VOREDACTDREDACTEDREDACTEDREDACTED0aQ explicit debug2: pubkey_prepare: done debug1: Offering public key: /data/user/0/com.termux/files/home/.ssh/keys/ssh_key ED25519 SHA256:9VOREDACTDREDACTEDREDACTEDREDACTED0aQ explicit debug2: we sent a publickey packet, wait for reply debug1: Server accepts key: /data/user/0/com.termux/files/home/.ssh/keys/ssh_key ED25519 SHA256:9VOREDACTDREDACTEDREDACTEDREDACTED0aQ explicit Authenticated to SSH_SERVER_IP ([SSH_SERVER_IP]:SSH_SERVER_PORT) using "publickey". debug1: Remote connections from 127.0.0.1:5555 forwarded to local address 127.0.0.1:5555 debug2: fd 3 setting TCP_NODELAY debug1: Requesting no-more-sessions@openssh.com debug1: Entering interactive session. debug1: pledge: filesystem debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0 debug1: client_input_hostkeys: searching /data/data/com.termux/files/home/.ssh/known_hosts for [SSH_SERVER_IP]:SSH_SERVER_PORT / (none) debug1: client_input_hostkeys: searching /data/data/com.termux/files/home/.ssh/known_hosts2 for [SSH_SERVER_IP]:SSH_SERVER_PORT / (none) debug1: client_input_hostkeys: hostkeys file /data/data/com.termux/files/home/.ssh/known_hosts2 does not exist debug1: client_input_hostkeys: no new or deprecated keys from server debug1: pledge: network debug1: Remote: /home/SSH_USER/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding debug1: Remote: /home/SSH_USER/.ssh/authorized_keys:1: key options: agent-forwarding port-forwarding pty user-rc x11-forwarding debug1: remote forward success for: listen 127.0.0.1:5555, connect 127.0.0.1:5555 debug2: forwarding_success: -1 expected forwarding replies remaining debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 41003 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54080 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 60169 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54096 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 5 setting O_NONBLOCK debug2: fd 5 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=5 debug1: channel 1: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 1: connected to 127.0.0.1 port 5555 debug2: channel 1: read failed rfd 5 maxlen 32768: Broken pipe debug2: channel 1: read failed debug2: chan_shutdown_read: channel 1: (i0 o0 sock 5 wfd 5 efd -1 [closed]) debug2: channel 1: input open -> drain debug2: channel 1: ibuf empty debug2: channel 1: send eof debug2: channel 1: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: rcvd close debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 2 debug2: channel 1: rcvd eof debug2: channel 1: output open -> drain debug2: channel 1: rcvd close debug2: channel 1: obuf empty debug2: chan_shutdown_write: channel 1: (i3 o1 sock 5 wfd 5 efd -1 [closed]) debug2: chan_shutdown_write: channel 1: shutdown() failed for fd 5 [i3 o1]: Transport endpoint is not connected debug2: channel 1: output drain -> closed debug2: channel 1: send_close2 debug2: channel 1: send close for remote id 2 debug2: channel 1: is dead debug2: channel 1: garbage collecting debug1: channel 1: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54104 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54114 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54120 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 36889 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54126 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 5 setting O_NONBLOCK debug2: fd 5 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=5 debug1: channel 1: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 1: connected to 127.0.0.1 port 5555 debug2: channel 1: read failed rfd 5 maxlen 32768: Broken pipe debug2: channel 1: read failed debug2: chan_shutdown_read: channel 1: (i0 o0 sock 5 wfd 5 efd -1 [closed]) debug2: channel 1: input open -> drain debug2: channel 1: ibuf empty debug2: channel 1: send eof debug2: channel 1: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: rcvd close debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 2 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 2 debug2: channel 1: rcvd eof debug2: channel 1: output open -> drain debug2: channel 1: rcvd close debug2: channel 1: obuf empty debug2: chan_shutdown_write: channel 1: (i3 o1 sock 5 wfd 5 efd -1 [closed]) debug2: chan_shutdown_write: channel 1: shutdown() failed for fd 5 [i3 o1]: Transport endpoint is not connected debug2: channel 1: output drain -> closed debug2: channel 1: send_close2 debug2: channel 1: send close for remote id 1 debug2: channel 1: is dead debug2: channel 1: garbage collecting debug1: channel 1: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54136 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54142 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54144 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 50485 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54154 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 5 setting O_NONBLOCK debug2: fd 5 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=5 debug1: channel 1: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 1: connected to 127.0.0.1 port 5555 debug2: channel 1: read failed rfd 5 maxlen 32768: Broken pipe debug2: channel 1: read failed debug2: chan_shutdown_read: channel 1: (i0 o0 sock 5 wfd 5 efd -1 [closed]) debug2: channel 1: input open -> drain debug2: channel 1: ibuf empty debug2: channel 1: send eof debug2: channel 1: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: rcvd close debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 2 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 2 debug2: channel 1: rcvd eof debug2: channel 1: output open -> drain debug2: channel 1: rcvd close debug2: channel 1: obuf empty debug2: chan_shutdown_write: channel 1: (i3 o1 sock 5 wfd 5 efd -1 [closed]) debug2: chan_shutdown_write: channel 1: shutdown() failed for fd 5 [i3 o1]: Transport endpoint is not connected debug2: channel 1: output drain -> closed debug2: channel 1: send_close2 debug2: channel 1: send close for remote id 1 debug2: channel 1: is dead debug2: channel 1: garbage collecting debug1: channel 1: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54156 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54164 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54180 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 56639 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54186 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 5 setting O_NONBLOCK debug2: fd 5 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=5 debug1: channel 1: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 1: connected to 127.0.0.1 port 5555 debug2: channel 1: read failed rfd 5 maxlen 32768: Broken pipe debug2: channel 1: read failed debug2: chan_shutdown_read: channel 1: (i0 o0 sock 5 wfd 5 efd -1 [closed]) debug2: channel 1: input open -> drain debug2: channel 1: ibuf empty debug2: channel 1: send eof debug2: channel 1: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: rcvd close debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 2 debug2: channel 1: rcvd eof debug2: channel 1: output open -> drain debug2: channel 1: rcvd close debug2: channel 1: obuf empty debug2: chan_shutdown_write: channel 1: (i3 o1 sock 5 wfd 5 efd -1 [closed]) debug2: chan_shutdown_write: channel 1: shutdown() failed for fd 5 [i3 o1]: Transport endpoint is not connected debug2: channel 1: output drain -> closed debug2: channel 1: send_close2 debug2: channel 1: send close for remote id 2 debug2: channel 1: is dead debug2: channel 1: garbage collecting debug1: channel 1: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54192 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54206 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768 debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 54218 debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555) debug2: fd 4 setting O_NONBLOCK debug2: fd 4 setting TCP_NODELAY debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4 debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0) debug1: confirm forwarded-tcpip debug1: channel 0: connected to 127.0.0.1 port 5555 debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe debug2: channel 0: read failed debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed]) debug2: channel 0: input open -> drain debug2: channel 0: ibuf empty debug2: channel 0: send eof debug2: channel 0: input drain -> closed debug2: channel 0: rcvd eof debug2: channel 0: output open -> drain debug2: channel 0: obuf empty debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed]) debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected debug2: channel 0: output drain -> closed debug2: channel 0: rcvd close debug2: channel 0: send_close2 debug2: channel 0: send close for remote id 1 debug2: channel 0: is dead debug2: channel 0: garbage collecting debug1: channel 0: free: 127.0.0.1, nchannels 1 debug2: client_check_window_change: changed ```

Any help? Feel free to ask anything.

rom1v commented 2 months ago

@kuolemaaa Read https://github.com/Genymobile/scrcpy/blob/master/doc/tunnels.md#ssh-tunnel

kuolemaaa commented 2 months ago

@kuolemaaa Read https://github.com/Genymobile/scrcpy/blob/master/doc/tunnels.md#ssh-tunnel

@rom1v I've read it already but I don't understand why it should be useful to me since I cannot even connect to adb yet. I managed connect a remote computer to an android dev using another device in the middle like so:

android  |  local  |laptop                    |  inet   | ssh server (me) |
listening|         |adb listening :5057       |         |                 |
:: :5555 |<--------|adb connect               |         |                 |
____ ____|         |ssh -R 5057:127.0.0.1:5057|-------->|  adb shell      |
    ^                                                            |
    |____________________________________________________________|

But this configuration is no use to me.

What I need to do is:

android                              |   inet    |  ssh server (me)
listening :5555                      |           |  
(termux) ssh -R 5555:127.0.0.1:5555  |---------->|  adb connect 127.0.0.1:5555 ; adb shell
          ^                                                         |
          |_________________________________________________________|

In this configuration the tunnel actually works (tested letting netcat listening on the android device and reverse-port-forward to the ssh server)

but it doen't work forwarding port 5555 and running adb connect 127.0.0.1:5555 on the server.

What I got is this block of messages, repeating, changing connection port at every attempt:

debug1: client_input_channel_open: ctype forwarded-tcpip rchan 1 win 2097152 max 32768
debug1: client_request_forwarded_tcpip: listen 127.0.0.1 port 5555, originator 127.0.0.1 port 41003
debug1: connect_next: start for host 127.0.0.1 ([127.0.0.1]:5555)
debug2: fd 4 setting O_NONBLOCK
debug2: fd 4 setting TCP_NODELAY
debug1: connect_next: connect host 127.0.0.1 ([127.0.0.1]:5555) in progress, fd=4
debug1: channel 0: new forwarded-tcpip [127.0.0.1] (inactive timeout: 0)
debug1: confirm forwarded-tcpip
debug1: channel 0: connected to 127.0.0.1 port 5555
debug2: channel 0: read failed rfd 4 maxlen 32768: Broken pipe
debug2: channel 0: read failed
debug2: chan_shutdown_read: channel 0: (i0 o0 sock 4 wfd 4 efd -1 [closed])
debug2: channel 0: input open -> drain
debug2: channel 0: ibuf empty
debug2: channel 0: send eof
debug2: channel 0: input drain -> closed
debug2: channel 0: rcvd eof
debug2: channel 0: output open -> drain
debug2: channel 0: obuf empty
debug2: chan_shutdown_write: channel 0: (i3 o1 sock 4 wfd 4 efd -1 [closed])
debug2: chan_shutdown_write: channel 0: shutdown() failed for fd 4 [i3 o1]: Transport endpoint is not connected
debug2: channel 0: output drain -> closed
debug2: channel 0: rcvd close
debug2: channel 0: send_close2
debug2: channel 0: send close for remote id 1
debug2: channel 0: is dead
debug2: channel 0: garbage collecting
debug1: channel 0: free: 127.0.0.1, nchannels 1
rom1v commented 2 months ago
android                              |   inet    |  ssh server (me)
listening :5555                      |           |  
(termux) ssh -L 5555:127.0.0.1:5555  |---------->|  adb connect 127.0.0.1:5555 ; adb shell
          ^                                                         |
          |_________________________________________________________|

Typo in this diagram: you probably meant ssh -R on the left (but it was correct in your previous comment).

Your commands and redirections look correct to me. I don't know why it does not work.

channel 0: read failed rfd 4 maxlen 32768: Broken pipe

Maybe an issue with the version/build configuration of OpenSSH for termux? Possibly related:

kuolemaaa commented 2 months ago
android                              |   inet    |  ssh server (me)
listening :5555                      |           |  
(termux) ssh -L 5555:127.0.0.1:5555  |---------->|  adb connect 127.0.0.1:5555 ; adb shell
          ^                                                         |
          |_________________________________________________________|

Typo in this diagram: you probably meant ssh -R on the left (but it was correct in your previous comment).

Your commands and redirections look correct to me. I don't know why it does not work.

channel 0: read failed rfd 4 maxlen 32768: Broken pipe

Maybe an issue with the version/build configuration of OpenSSH for termux? Possibly related:

* [Connection drops after authentication PowerShell/Win32-OpenSSH#1924](https://github.com/PowerShell/Win32-OpenSSH/issues/1924)

* [scp giving EOF and exit status 1 tailscale/tailscale#8592](https://github.com/tailscale/tailscale/issues/8592)

Yea, typos on the messages, I meant -R.

I will look at your linked issues.

By the way I managed to use adb+scrcpy over internet using a tool of network mesh. I really dont know why my ssh solution doesnt work. Maybe termux fault? I dont know.