tor_ssh.sh

Infrastructure

remote access scripts

SHOW HN2019

93points
65comments
#522of 2,195 in 2019
Top 24%of 2019 by points

How HN took it

CuriousMostly questions and neutral comments

2 positive, 9 neutral or asking, 2 mixed, 5 critical, out of 18 comments about the project. Thread score -0.16.

Idea: 1 for, 0 againstExecution: 0 for, 1 againstPrivacy: 0 for, 1 againstPerformance: 1 for, 0 againstDocs: 0 for, 1 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Useful NAT traversal use case

    From 2 comments
    • NAT traversal is a useful and underrated Tor hidden service use case. Careful though: installing the version of Tor which is included in Ubuntu’s distribution is not recommended,…
      buildbuildbuild on HN
    • Will ssh experience timeouts and connection aborts detailed here http://sites.inka.de/bigred/devel/tcp-tcp.html or is that not applicable? Nice script BTW.
      0xdeadbeefbabe on HN
  • Useful for debugging CI builds

    From 1 comment
    • This is also valuable for debugging CI builds, and it can be more secure than the debugging mode CI services provide when coupled with an ssh key. For example on Travis CI a host…
      dessant on HN

Objections

  • Overwrites torrc instead of appending

    From 2 comments
    • ``` # Append the hidden service configuration to the Torrc file echo -e "HiddenServiceDir /var/lib/tor/onion-ssh/\nHiddenServicePort 22 127.0.0.1:22" > /etc/tor/torrc ``` Unless…
      berbec on HN
    • The default ubuntu torrc has everything commented out so is effectively blank anyway. Using ">" instead of ">>" means you don't end up with multiple copies of the same hidden…
      jstanley on HN
  • Piping curl to bash is unsafe

    From 2 comments
    • I like the theory behind this and the motivation. But this has to stop: ># Usage (as root): $ bash <(curl -s https://gitlab.com/grownetics/devops/raw/master/tor_ssh.sh) Spoon…
      UI_at_80x24 on HN
    • I understand what you are saying, but respectfully disagree. Conditioning people to use `curl | bash` trains them to not review anything and blindly run untrusted code. I have…
      LinuxBender on HN
  • Uses deprecated Onion v2 addresses

    From 1 comment
    • How come you aren't using ```HiddenServiceVersion 3```? Onion v2 (16 char addresses) uses old crypto (SHA1/DH/RSA1024) and has now been superseded by Onion v3 (56 char addresses,…
      jamieweb on HN
  • Ubuntu-only assumption

    From 2 comments
    • tor_ssh.sh – One command to enable SSH access via Tor to some servers: Debian is not the entirety of Linux
      bromonkey on HN
    • "any server" running ubuntu...
      throwaway2048 on HN

Requests

  • Add check before appending hidden service config

    From 2 comments
    • Maybe something like ``` if [ $(grep "HiddenServicePort 22" /etc/tor/torrc | wc -l) -eq 0] ```
      berbec on HN
    • Exactly, for simplicity since nothing is in there by default, it gets overwritten. To keep the script nice and short I decided not to add that detection. I would happily merge…
      NickBusey on HN
  • Use Onion v3 addresses

    From 1 comment
    • How come you aren't using ```HiddenServiceVersion 3```? Onion v2 (16 char addresses) uses old crypto (SHA1/DH/RSA1024) and has now been superseded by Onion v3 (56 char addresses,…
      jamieweb on HN
  • Use Tor project PPA instead of Ubuntu package

    From 1 comment
    • NAT traversal is a useful and underrated Tor hidden service use case. Careful though: installing the version of Tor which is included in Ubuntu’s distribution is not recommended,…
      buildbuildbuild on HN

Questions

  • Why not use HiddenServiceVersion 3

    From 1 comment
    • How come you aren't using ```HiddenServiceVersion 3```? Onion v2 (16 char addresses) uses old crypto (SHA1/DH/RSA1024) and has now been superseded by Onion v3 (56 char addresses,…
      jamieweb on HN
  • Why the systemd replacement and restart behaviour

    From 2 comments
    • This line was puzzling: ``` # Remove the bogus tor service Ubuntu installs by default ``` Is there a bug in the upstream package or something? Otherwise this just looks like a…
      acdha on HN
    • Typically I'd put that into a comment right above that line. I'd also really be inclined to install a replacement service instead so you'd get automatic restarts if you aren't…
      acdha on HN

Alternatives named

  • ZeroTier

    From 1 comment
    • I highly recommend ZeroTier for maintaining stable connectivity and static private IPs regardless of NAT or networking environment peculiarities. It also supports multipath…
      buildbuildbuild on HN
  • torsocks

    From 2 comments
    • There's also torsocks or even tsocks if you need something more battle tested. EDIT: I stand corrected, see @buildbuildbuild reply.
      ressetera on HN
    • That does the reverse: allows you to connect to public IP addresses through Tor. This solution exposes your local SSH server as a static hidden service without needing to forward…
      buildbuildbuild on HN
  • tinc and WireGuard

    From 1 comment
    • This works pretty well, especially if you have personal computers behind different NATs. One of the issue is still that you have to distribute the tor domain name out all over…
      pwnna on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/19310747)