fasmide / remotemoe

tunnels to localhost and other ssh plumbing
MIT License
278 stars 31 forks source link

Can't see a domain if -N option is set #25

Closed stokito closed 1 year ago

stokito commented 1 year ago

This is probably not a bug but maybe there is some solution. The OpenWrt sshtunnel package ads the -N (and also -n) and after this I can't see a generated domain in logs. But I can see the banner text. So maybe there is some workaround for this.

I created a PR for the OpenWrt sshtunnel were removed the problematic option https://github.com/openwrt/packages/pull/21263#issuecomment-1601708542

Still maybe someone else who just copied the ssh command from random site may be wondered what's wrong.

-N Do not execute a remote command. This is useful for just for‐ warding ports. Refer to the description of SessionType in ssh_config(5) for details.

Example 1. Usual output:

ssh remote.moe -R localhost:3000
http (3000)
http://xk4v7bmrsexfl3xhbinjtxhubymk6bomc5txckch77bcpqfojgka.remote.moe:3000/

ssh remote.moe -N -R localhost:3000

E.g. nothing

Similar problem https://github.com/pcarrier/srv.us/issues/18

fasmide commented 1 year ago

I think this is the intended purpose of the -N (and, to some extent, also the lowercased -n) - from the ssh client manual:

     -N      Do not execute a remote command.  This is useful for just
             forwarding ports.  Refer to the description of SessionType
             in ssh_config(5) for details.

Technically the ssh client doesn't open a shell, making it impossible for the remotemoe daemon to communicate with the client. The only channels opened when using the -N are the forwarding of traffic channels.

The lowercased -n does open up a shell, but it simply pipes any output into /dev/null, so while behaving differently, the result is pretty much the same (in remotemoe's case, anyways)

stokito commented 1 year ago

ok, it's not possible to implement, closing. Thank you for your product ans supprort