summaryrefslogtreecommitdiffstats
path: root/ssh.py
AgeCommit message (Collapse)Author
2011-02-07server: workaround for idiotic ArchLinux renaming of python to python2.Avery Pennarun
First try running under python2, then python if that doesn't exist.
2011-01-25Implement the optional fullness checking a bit more like I like it.Avery Pennarun
Looks like it worked before, but personal preference is a killer. The new name is "--no-latency-control".
2011-01-25new option to disable fullness checkingRoger
On high latency links, the PING/PONG round trip triggered by fullness checking could kill the bandwidth. Disabling it could result in >10x bandwidth increase in some setups where the existing latency is already high and the available bandwidth is also high.
2010-12-31Rearrange daemonization/syslog stuff and make it more resilient.Avery Pennarun
Rename --background to -D/--daemon, to match other programs (like smbd). You can now have --syslog even without --daemon. Avoid using atexit(); try/finally is better. Don't just close stderr; we'll end up eating error output from ssh! Instead, redirect stderr to a 'logger' subprocess that will send to syslog. Delay redirecting stderr until after we know we're daemonizing, so handy error messages can go to stderr instead of syslog. Make pidfile stuff more resilient: support already-existing files, files with strict permissions, outdated files containing an already-dead pid. Add a --pidfile option to let you specify the pidfile path. chdir("/") while daemonizing, so that the filesystem containing $PWD can later be unmounted without killing the daemon. fw.done() can't wait on the firewall subprocess on exit when daemonized; we no longer are the parent of that process.
2010-12-09Oops, earlier ipv6 patch didn't work if no -r option is specified.Avery Pennarun
2010-11-19Add support for IPv6 remote hosts.Christopher Bowns
Supported sshuttle commands for IPv6: ./sshuttle -r "IPv6:addr" 0.0.0.0/0 -vv ./sshuttle -r "[IPv6:addr]" 0.0.0.0/0 -vv ./sshuttle -r "[IPv6:addr]:22" 0.0.0.0/0 -vv Technically "invalid" address/port formats, but they can still be parsed because they’re unambiguous, so these also work: ./sshuttle -r "IPv6:addr]" 0.0.0.0/0 -vv ./sshuttle -r "IPv6:addr]:" 0.0.0.0/0 -vv ./sshuttle -r "IPv6:addr]:22" 0.0.0.0/0 -vv ./sshuttle -r "[IPv6:addr" 0.0.0.0/0 -vv (If you have a Mac with Back To My Mac, use dns-sd to discover the remote host's IPv6 address: dns-sd -G v4v6 <machine name>.<member name>.members.mac.com )
2010-11-09Add a new --ssh-cmd= option to let you override the ssh command.Avery Pennarun
Requested by Axel Beckert.
2010-10-01import and use subprocess.py from python 2.6.Avery Pennarun
This should hopefully let us run even on python 2.3 on really old servers.
2010-10-01ssh.py: don't os.setsid().Avery Pennarun
This prevents ssh from asking for a password successfully. Error reported by Chetan Kunte.
2010-09-03add option to allow the remote python binary's name/path to be specifiedchocolateboy
2010-05-12ssh.py: try harder to find required *.py files.Avery Pennarun
Search the entire python sys.path, not just the directory that argv[0] is in. That way if you symlink the sshuttle binary into (for example) ~/bin, it'll be able to work correctly.
2010-05-08Added new --auto-hosts and --seed-hosts options to the client.Avery Pennarun
Now if you use --auto-hosts (-H), the client will ask the server to spawn a hostwatcher to add names. That, in turn, will send names back to the server, which sends them back to the client, which sends them to the firewall subprocess, which will write them to /etc/hosts. Whew! Only the firewall process can write to /etc/hosts, of course, because only he's running as root. Since the name discovery process is kind of slow, we cache the names in ~/.sshuttle.hosts on the remote server. Right now, most of the names are discovered using nmblookup and smbclient, as well as by reading the existing entries in /etc/hosts. What would really be nice would be to query active directory or mdns somehow... but I don't really know how those work, so this is what you get for now :) It's pretty neat, at least.
2010-05-04Don't require the remote server to have sshuttle installed.sshuttle-0.20Avery Pennarun
Instead, grab our source code, send it over the link, and have python eval it and then start the server.py main() function. Strangely, there's now *less* horrible stuff in ssh.py, because we no longer have to munge around with the PATH environment variable. And this significantly reduces the setup required to get sshuttle going. Based on a suggestion from Wayne Scott.
2010-05-04ssh.py: allow hostnames of the form hostname:portAvery Pennarun
Feature requested by Wayne Scott and Ed Maste.
2010-05-02ssh.py: support finding sshuttle in "$HOME/.../sshuttle"Avery Pennarun
If you ran sshuttle from /home/apenwarr/sshuttle/sshuttle, we would automatically add /home/apenwarr/sshuttle to the PATH before trying to execute sshuttle on the remote machine. That way, if you install it in the same place on two computers, the client would still be able to start the server. Someone reported, though, that if they installed the client in /home/apenwarr/sshuttle/shuttle, and the server in /root/sshuttle/sshuttle, then used "-r root@servername", it wasn't able to find the program. Similar problems would happen if you're apenwarr at home and averyp at work. So what we now do is add *two* directories to the PATH: /home/apenwarr/sshuttle and $HOME/sshuttle, where $HOME is the value of $HOME on the *server*, not the client. So it'll find it in either place.
2010-05-02iptables: more resilient startup/cleanup.Avery Pennarun
Now the sudo iptables subprocess persists for the entire life of sshuttle. The benefits of this are: - no need to authenticate again at shutdown (failure of which could cause us to not clean up iptables) - if the main process dies unexpectedly, iptables still gets cleaned up - the password prompt can happen *before* starting the ssh/server process, which means it'll stand out and the password prompt won't be overwritten.
2010-05-02Don't bother with a backtrace when we produce certain fatal errors.Avery Pennarun
We'll introduce a new "Fatal" exception for this purpose, and throw it when we just want to print a user message and abort immediately.
2010-05-02Add a -v (and -vv) flag and decrease default message verbosity.Avery Pennarun
2010-05-02Clean up SockWrapper.peername stuff.Avery Pennarun
Some fds don't have peernames, and sometimes the peername isn't very helpful, so let's fill it in by hand when appropriate.
2010-05-02ssh.py: use 'exec sshuttle' to get rid of the extra sh process.Avery Pennarun
2010-05-01Basic implementation of a multiplex protocol - client side only.Avery Pennarun
Currently the 'server' is just a pipe to run 'hd' (hexdump) for looking at the client-side results. Lame, but true.
2010-05-01Initial commit.Avery Pennarun
Importing options.py, ssh.py, and LICENSE from the bup project.