15 comments

  • antoniomika1 hour ago
    A number of years ago, I created a fully open source (MIT) project called sish [0] that does just this.<p>sish is a SSH server written specifically for tunneling. You get all of the benefits of SSH, but also automatic TLS, a web console of requests a tunnel has received, and various other features. You can also tunnel more than just HTTP(S). You can tunnel websockets, TCP connections, and even have internal alias connections for using ProxyJump within the tunnel. All stateless and all protected with SSH auth.<p>If you’re not interested in self hosting, there’s a hosted version at tuns.sh [1] that has multi region support and a few other cool features (including UDP tunneling) as part of the pico.sh [2] membership ($2&#x2F;mo). Happy to answer any questions in this space!<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;antoniomika&#x2F;sish" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;antoniomika&#x2F;sish</a><p>[1] <a href="https:&#x2F;&#x2F;tuns.sh" rel="nofollow">https:&#x2F;&#x2F;tuns.sh</a><p>[2] <a href="https:&#x2F;&#x2F;pico.sh" rel="nofollow">https:&#x2F;&#x2F;pico.sh</a>
    • pbreit46 minutes ago
      sish does get a mention: &quot;Some only require a plain SSH client but rely on a specific SSH server, like sish.:
  • toomim5 hours ago
    For this stuff, I&#x27;m most excited about https over iroh.<p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;aflin&#x2F;iroh-webproxy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;aflin&#x2F;iroh-webproxy</a><p>- <a href="https:&#x2F;&#x2F;github.com&#x2F;n0-computer&#x2F;iroh-proxy-utils" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;n0-computer&#x2F;iroh-proxy-utils</a><p>No port forwarding. No public IP required. No special proxy to set up.<p>Iroh already runs public relays. Your two computers will signal through those, and then port-knock and form a direct connection to each other, perfectly encrypted.<p>We just need to define a new https:&#x2F;&#x2F; url, like ... let&#x27;s call it &quot;irohttps:&#x2F;&#x2F;&quot; maybe, so then you could contact my laptop with &quot;irohttps:&#x2F;&#x2F;&lt;hash&gt;&#x2F;path?query&quot;.
    • Muromec4 hours ago
      &gt;and then port-knock and form a direct connection to each other, perfectly encrypted.<p>so... ICE&#x2F;TURN&#x2F;STUN ? Sorry I forgot which one of them actually works, but they do work
      • flippingheck1 hour ago
        Yes, and TLS&#x2F;QUIC&#x2F;Wireguard all offer encryption.<p>What toomim is excited about is this combination of technologies, and that&#x27;s more than just NAT punching or encryption.
    • _def3 hours ago
      iroh-ssh works today: <a href="https:&#x2F;&#x2F;github.com&#x2F;rustonbsd&#x2F;iroh-ssh" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rustonbsd&#x2F;iroh-ssh</a><p>Not perfectly, but good enough for port forwarding web interfaces through cgnat
  • jamiesonbecker1 hour ago
    This is wildly over-complicated and also has a bunch of footguns and security risks.<p>For example, that very first NGINX section allows an attacker to direct their incoming traffic to any arbitrary listening port on localhost. They can even write a simple for loop in bash that would use curl to test all of the different ports. This also bypasses any firewall rules that you might have blocking traffic from the outside world.<p>be very careful following the instructions in this article.<p>Read the man page for SSH, and especially the remote forward section. <a href="https:&#x2F;&#x2F;man7.org&#x2F;linux&#x2F;man-pages&#x2F;man1&#x2F;ssh.1.html" rel="nofollow">https:&#x2F;&#x2F;man7.org&#x2F;linux&#x2F;man-pages&#x2F;man1&#x2F;ssh.1.html</a>
    • vbernat45 minutes ago
      The attack you mention is solved in the second part of the article.
      • jamiesonbecker27 minutes ago
        I did notice that you tried to mitigate the risk, but why not just pick a high port rather than this complex redirection?<p>Your scheme is smart and creative but unnecessarily risky.<p>SSH can do remote listens to the world by itself, no second nginx needed, but sish or ngrok might be a better solution for the general case.<p>Anytime you punch holes, you&#x27;re taking a risk, so make it as narrow as you can.
        • vbernat8 minutes ago
          It&#x27;s already using a high port. Forwarding a high port directly with SSH prevent exposing the service through a virtual host and provide HTTPS (but I didn&#x27;t think of it until your mentioned it). And it would open the service to be discovered by enumerating all possible ports, like you mentioned in your first comment.<p>sish and ngrok are mentioned in the intro along with the reasons I didn&#x27;t go this way (specific SSH server to run for the first and not self-hosted for the later).<p>This domain is crowded with solutions. I only explored that myself because the &quot;free&quot; solutions only requiring an SSH client were unreliable, including the free tier of ngrok (broken SSH tunnel).
  • aliasxneo6 hours ago
    This is one of the core things I&#x27;ve been working towards with DNTLS [1]. I love the idea of tunnels, especially for sharing between private parties. The SaaS providers (Tailscale, Cloudflare, etc.) have done a good job making it really easy on their infra, but it really blurs the line of &quot;self-hosted&quot; to me. Ideally we end up with solutions like this that can be run entirely without an intermediary.<p>[1]: <a href="https:&#x2F;&#x2F;dntls.substack.com&#x2F;p&#x2F;the-new-internet" rel="nofollow">https:&#x2F;&#x2F;dntls.substack.com&#x2F;p&#x2F;the-new-internet</a>
    • gonzalohm4 hours ago
      So like wireguard then?
      • subscribed3 hours ago
        Yeah, and Dropbox is just rsync and scp :)
      • aliasxneo4 hours ago
        If that&#x27;s all that was necessary then I feel like a lot of these SaaS tools wouldn&#x27;t be as popular. I suspect a lot of Tailscale&#x27;s success is because wireguard is not easy nor does it solve the full problem space (i.e. discovery). With `tailscale serve` I can get a private HTTPS endpoint to my local machine in almost no time.
  • soltanov22 minutes ago
    I like that the design composes existing tools instead of creating a new daemon, but what threat model covers leaked URLs, tunnel enumeration, forwarded credentials, and abandoned sessions?
  • pbreit45 minutes ago
    Instead of tunneling, why aren&#x27;t there easier ways to develop and deploy to publicly accessible servers (for mere mortals)?
  • gonzalohm4 hours ago
    I don&#x27;t have the code at hand, but I think it&#x27;s better to just have a nginx server that only serves content if the browser has a specific certificate installed. That way you generate a key pair, share the public key with anyone that you want to share the content with and that&#x27;s it.<p>Downside is that some browsers don&#x27;t handle the certificates properly (especially on phones)
    • jagged-chisel3 hours ago
      An HTPS server always hands out its public key. Do you mean client secrets or something?
      • nvme0n1p12 hours ago
        Sounds like he&#x27;s talking about mTLS&#x2F;client certificates. <a href="https:&#x2F;&#x2F;blog.mozilla.org&#x2F;security&#x2F;2021&#x2F;07&#x2F;28&#x2F;making-client-certificates-available-by-default-in-firefox-90&#x2F;" rel="nofollow">https:&#x2F;&#x2F;blog.mozilla.org&#x2F;security&#x2F;2021&#x2F;07&#x2F;28&#x2F;making-client-c...</a>
  • snehesht5 hours ago
    I&#x27;m working on something similar with userspace wireguard, will share it soon.
  • guessmyname6 hours ago
    If self-hosted, then why do you need a third-party service *.ssh.luffy.cx ?
    • benatkin5 hours ago
      You replace it with your domain.
  • Transformanshen4 hours ago
    This is what I needed, but I didn&#x27;t know it
  • superkuh3 hours ago
    I forward port 80&#x2F;443 on my router to port 80&#x2F;443 on my home LAN nginx webserver and point my domain name to my home IPv4. Then I put files in directories. It works great and has worked great for a couple decades. While the number of static nginx vulnerabilities that have come out since AI became good at coding has increased I still haven&#x27;t run into one that applies to my simple static nginx setup. All this tunneling and secrecy and credentials is... well, it applies to some cases and I don&#x27;t want to dismiss those. But it really doesn&#x27;t apply to most human person&#x27;s use cases. Just host a normal server on your home IPv4. There&#x27;s nothing to break.
    • tredre33 hours ago
      &gt; Just host a normal server on your home IPv4. There&#x27;s nothing to break.<p>There is a privacy aspect. For example you seem to have watched Meet Joe Black and Six Days Seven Nights recently. Do you care that we know that? Maybe not, but I can also see the porn you enjoyed.
      • superkuh3 hours ago
        I don&#x27;t understand how you would know that. If you mean those sites where you put in an ip address and get a list of torrents that IPv4 has been associated with then I guess you aren&#x27;t aware that those things are wildly inaccurate in the false positive sense. Because of this I am not sure if you were just giving a made up example of information you might find on those sites, or if you actually checked my profile and pinged superkuh.com to get my ipv4 and ran it and got fake results. An IP address is not private info. It&#x27;s how we participate with each other on the internet. In either case I&#x27;m not worried because I know those site&#x27;s purported results don&#x27;t mean anything. If you mean nation state level actors or the like, well, yeah. That threat model is a bit beyond this.<p>It is much more private to host on your static webserver and link your friend to http(s):&#x2F;&#x2F;my.ip.goes.here&#x2F;orwhatever.jpg than it is to use a third party corporate services that both establish third party doctorine of no assumption of privacy and who have a profit-motive to sell your info. Do it yourself and you have a legal assumption of privacy and no one&#x27;s continued existence is dependent upon selling information about you.
    • jagged-chisel3 hours ago
      ISP ToS become an issue. Certainly depends on how rabidly one’s ISP enforces the rule …
  • esseph4 hours ago
    While I do appreciate very much the &quot;we already have the technology, let&#x27;s just use it!&quot; approach + the self hosting aspect, one of the downsides of self hosting without a proxy is having to expose your endpoint and likely having minimal defensive tools.
    • DominoTree1 hour ago
      It seems like every day there&#x27;s some new &quot;expose your laptop to the internet!!!111&quot; service (or protocol or methodology) that I have to block or otherwise disable at work.<p>Users and their agents are constantly trying to make all sorts of horrible things forward-facing, and what sucks is that there&#x27;s not a comprehensive way to block this stuff categorically without severely impacting a ton of legitimate usage.<p>(And yes, we have _very_ easy sanctioned ways for users to deploy things onto actual managed hosts and make them forward-facing)
  • lin7c1 hour ago
    [flagged]