1. 04 Jan, 2021 1 commit
    • Scott Kuhl's avatar
      Improve error messages related to sshuttle server. (#580) · b7730fc1
      Scott Kuhl authored
      * Improve error messages related to sshuttle server.
      
      There are many GitHub issues related to the cryptic message:
      fatal: expected server init string 'SSHUTTLE0001'; got b''
      
      The code that prints that message is after another check that is
      intended to verify that the server is still running. This code was
      faulty since the server is still running when rv==None (but exited
      when rv==0).
      
      I corrected this problem and then investigated ways to clarify the
      error message. I added additional exit codes for the server: 97 (exec
      in the shell returned), 98 (the python exec() function called
      returned). The end result is that the cryptic error message above will
      now print a more appropriate error message that should aid in
      debugging.
      
      I also changed the server so that it catches Fatal() and exits with
      exit code 99 (like the client does). Previously, it was just an
      unhandled exception on the server.
      
      I suspect some of the error messages were caused by restricted shells.
      I also investigated and added comments about how sshuttle might behave
      if it is being run on a server that has a restricted shell.
      
      This commit also replaces a couple of exit() calls in cmdline.py with
      'return' since exit() is intended for interactive use. This change
      doesn't impact the server.
      
      * Remind user to exclude remote host when server exits with 255.
      b7730fc1
  2. 01 Jan, 2021 1 commit
    • Scott Kuhl's avatar
      Refactor debug, log and Fatal messages. · 7fc33c00
      Scott Kuhl authored
      This commit rewrites the log() function so that it will append a
      newline at the end of the message if none is present. It doesn't make
      sense to print a log message without a newline since the next log
      message (which will write a prefix) expects to be starting at the
      beginning of a line.
      
      Although it isn't strictly necessary, this commit also removes any
      newlines at the ends of messages. If I missed any, including the
      newline at the end of the message will continue to work as it did
      before.
      
      Previously, some calls were missing the newline at the end even though
      including it was necessary for subsequent messages to appear
      correctly.
      
      This code also cleans up some redundant prefixes. The log() method
      will prepend the prefix and the different processes should set their
      prefix as soon as they start.
      
      Multiline messages are still supported (although the prefix for the
      additional lines was changed to match the length of the prefix used
      for the first line).
      7fc33c00
  3. 31 Dec, 2020 1 commit
    • Scott Kuhl's avatar
      Ignore quotes in config file passed to sshuttle with @ · 563f4147
      Scott Kuhl authored
      When users put parameters in a config file and pass them to sshuttle
      using '@', they might copy the quotes from the command line into the
      config file. This fix first ensures that we strip whitespace from the
      beginning/end of each line in the config file. Then, if the line
      begins and ends with a matching quote character, strip those too.
      
      Fixes #573.
      563f4147
  4. 29 Dec, 2020 2 commits
  5. 28 Dec, 2020 10 commits
  6. 16 Dec, 2020 4 commits
  7. 14 Dec, 2020 4 commits
  8. 16 Nov, 2020 2 commits
  9. 07 Nov, 2020 1 commit
  10. 06 Nov, 2020 1 commit
  11. 05 Nov, 2020 2 commits
  12. 04 Nov, 2020 6 commits
  13. 29 Oct, 2020 2 commits
  14. 27 Oct, 2020 2 commits
  15. 26 Oct, 2020 1 commit
    • Scott Kuhl's avatar
      Intercept DNS requests sent by systemd-resolved. · 502960d7
      Scott Kuhl authored
      Previously, we would find DNS servers we wish to intercept traffic on
      by reading /etc/resolv.conf. On systems using systemd-resolved,
      /etc/resolv.conf points to localhost and then systemd-resolved
      actually uses the DNS servers listed in
      /run/systemd/resolve/resolv.conf. Many programs will route the DNS
      traffic through localhost as /etc/resolv.conf indicates and sshuttle
      would capture it. However, systemd-resolved also provides other
      interfaces for programs to resolve hostnames besides the localhost
      server in /etc/resolv.conf.
      
      This patch adds systemd-resolved's servers into the list of DNS
      servers when --dns is used.
      
      Note that sshuttle will continue to fail to intercept any traffic sent
      to port 853 for DNS over TLS (which systemd-resolved also supports).
      
      For more info, see:
      sshuttle issue #535
      https://www.freedesktop.org/software/systemd/man/systemd-resolved.service.html
      https://github.com/systemd/systemd/issues/6076
      502960d7