Comments (19)
I can add that I get the same results in an arch VM running gnome.
from sshuttle.
I've had the same issue on Arch Linux for the couple of weeks I've been using sshuttle.
from sshuttle.
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.
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.
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.
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.
from sshuttle.
Same issue for me on Debian SID with python 3.11.6-3
from sshuttle.
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.
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.
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.
Setting Defaults !use_pty
and it's working now :)
Thx !
from sshuttle.
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.
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.
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)
- Bypassing Internet Censorship HOT 1
- can't connect - "Whats wrong" HOT 4
- removing python requirement for systems with sshuttle preinstalled HOT 3
- SSHuttle Interferes with qemu networking on MacOS
- sw HOT 1
- Stopped working on MacOS Sonama HOT 7
- sshuttle seems to connect fine, but doesn't route traffic to the remote network HOT 1
- refused connections incorrectly get accepted HOT 5
- sshuttle woes with MacOS Sonoma HOT 8
- Sshutlle HOT 1
- failed to establish ssh session (2) HOT 1
- man page wrong, *buntu 22_04.3 HOT 5
- is there a way not to have sshuttle exit if one of the prefixes enter by domain name doesn't resolve ?
- [Suggestion] Potential way to traffic UDP with udp-over-tcp
- [Feature Request] Forward to localhost
- use it to access services behind a gcloud IAP tunnel HOT 1
- Alternative connection backend (websockets)
- Sshuttle 1.1.1 not working on macOS Sonoma 14.1.1 HOT 8
- sshuttle fails when different sudo message appears.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sshuttle.