GithubHelp home page GithubHelp logo

Comments (19)

kritag avatar kritag commented on June 23, 2024

I can add that I get the same results in an arch VM running gnome.

from sshuttle.

dancek avatar dancek commented on June 23, 2024

I've had the same issue on Arch Linux for the couple of weeks I've been using sshuttle.

from sshuttle.

dancek avatar dancek commented on June 23, 2024

After starting sshuttle as daemon I have terminal settings like this:

$ stty
speed 38400 baud; line = 0;
                           -brkint -icrnl -imaxbel iutf8
                                                        -opost
                                                              -isig -iexten

Running stty cooked or reset fixes a lot but not all of it. Eg. I still can't close the terminal with ^D.

from sshuttle.

dancek avatar dancek commented on June 23, 2024

My python version is actually 3.11.5 so this is probably caused by something else than python 3.12.

I also noticed that the process ID indicated in the file specified by --pidfile is not attached to a terminal, but some of the other processes spawned are attached to pts/0. So that explains why ctrl-D doesn't close the terminal window.

So I guess messing up the terminal is one bug and not properly disowning daemon processes is another bug.

from sshuttle.

Xazziri avatar Xazziri commented on June 23, 2024

I have the same issue running on Ubuntu 23.10 with Python 3.11.4-5, using either the provides sshuttle version 1.0.5-1ubuntu4 (from the repo's) or 1.1.1-1 installed as .deb package from Sid. This behavior happens using either the console, terminator or xfce4-terminal.

from sshuttle.

kritag avatar kritag commented on June 23, 2024

Fwiw it works on a fedora 38 liveISO, while (as stated initially) the issue at least for me is on fedora 39 and arch with python 3.12.

from sshuttle.

dancek avatar dancek commented on June 23, 2024

from sshuttle.

gnubibi33 avatar gnubibi33 commented on June 23, 2024

Same issue for me on Debian SID with python 3.11.6-3

from sshuttle.

skuhl avatar skuhl commented on June 23, 2024

Have you tried making sure that all versions of sshuttle are removed (installed via the system package manager, pip, etc) and then only installing a recent version of sshuttle? In the past, I've found that I've thought I was using one version of sshuttle but was actually using another. Or, there were multiple versions installed and being mixed in unexpected ways.

I can't reproduce this problem on Ubuntu 23.10 with either python 3.11 or 3.12 with sshuttle 1.1.1.

A similar sounding problem was fixed in #712 which should be in sshuttle 1.1.0 and could have caused garbled terminal output and Ctrl+C not to work. In #712 you can also find some links to other reported issues near the bottom.

Another option would be to try using the visudo command to disable the use_pty option in /etc/sudoers just to see if it fixes the problem. use_pty is a setting that has recently been turned on in many distributions and led to the fix in #712. I believe there are security reasons why use_pty has become the preferred default.

from sshuttle.

kritag avatar kritag commented on June 23, 2024

Thanks for the info! I was able to get this working on my current workstation running Arch by uncommenting #Defaults !use_pty from /etc/sudoers. I suspect this is also the case for Fedora, but thanks anyway for pointing to a solution!

If most distros have this as a default now, is it possible to somehow fix sshuttle to accomocate for people not having this uncommented in their /etc/sudoers?

from sshuttle.

dancek avatar dancek commented on June 23, 2024

Good to finally have some pointers on what's happening. Indeed, #712 fixes the use_pty behavior in the "normal" use case but running as daemon (-D) seems broken. Setting !use_pty for sudo is a workaround but it's not optimal.

Running stty cooked fixes the terminal behavior after starting a daemon, and sshuttle could probably do something like this with termios when daemonizing itself.

The daemonized sshuttle master process is using the TTY of the terminal you start it from, whether use_pty is used or not. So after daemonizing the typical terminal emulator won't quit even when you exit the shell, as its PTY is still being used. I guess this warrants another issue.

from sshuttle.

gnubibi33 avatar gnubibi33 commented on June 23, 2024

Setting Defaults !use_pty and it's working now :)

Thx !

from sshuttle.

skuhl avatar skuhl commented on June 23, 2024

Indeed, #712 fixes the use_pty behavior in the "normal" use case but running as daemon (-D) seems broken. Setting !use_pty for sudo is a workaround but it's not optimal.

Thanks for the info. I probably didn't check that #712 worked with daemon mode. I did check that using #712 makes sshuttle work when running normally from the command line regardless of the use_pty setting. I'll try to take a look at daemon mode to see if I can reproduce and fix the problem.

from sshuttle.

skuhl avatar skuhl commented on June 23, 2024

use_pty documentation from the man page says https://www.man7.org/linux/man-pages/man5/sudoers.5.html

A malicious program run under sudo may be capable of injecting commands into the user's terminal or running a background process that retains access to the user's terminal device even after the main program has finished executing. By running the command in a separate pseudo-terminal, this attack is no longer possible. This flag is on by default for sudo 1.9.14 and above.

sudo 1.9.14 appears to have been released around June 2023. It is unclear to me if this has other impacts besides the garbled terminal output.

from sshuttle.

dancek avatar dancek commented on June 23, 2024

PR #922 fixes this issue in my use case, but I'm unsure if it's the best possible implementation. @skuhl I'm hoping you could review the PR if you have time, please!

from sshuttle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.