AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |
Back to Blog
Windows ssh tunnel all traffic12/11/2023 ![]() ![]() That's why I come up with custom Powershell script, easy configurable, changeable, small, but works. I tried many solutions like SSH tunnel managers, but all were inconvinient for me: too many configuration screens, sometimes buggy (one time SSH tunnel manager purged all! settings I had! So I had to restore settings for all 30 tunnels). I did find this question: How to reliably keep an SSH tunnel open?, but that's using Linux as the SSH client, and I'm using Windows. I'm planning on making a dedicated user with no privileges and not allowed to interactively log in, and use that.) (Yes, I am aware of the hazards of automatically logging in to SSH. ![]() The two tunnels are one local tunnel, and one remote tunnel. The data I'm sending across the two tunnels is VNC connections, so I often won't be at the machine to clear errors and enter passwords. What I'd like to do is have an application that can set up the two SSH tunnels, and can automatically reconnect, without needing to manually do anything, including enter a password. This works well, except when the SSH connection drops: PuTTY displays an error message, and I need to manually close the error and reconnect to the server. Press OK and Close to close the preferences dialogs.I'm trying to set up a Windows computer to always have two SSH tunnels to my Linux server.Ĭurrently, I'm using PuTTY to open the two SSH tunnels: I log in to the server in PuTTY, leave it minimized, and never touch it.Enter 1234 as port (the same port as specified in the SSH command).In your browser, you can enter localhost as host and 1234 as port at SOCKS4/5 server.īelow is an example in the Firefox browser: ![]() To enable the SOCKS server, run the next command in a terminal: ssh -D1234 Setting up a SOCKS proxy is not difficult: it's built-in in OpenSSH. For browsing through your server, you may set up a SOCKS server. Otherwise, no communication is possible between the server and clientĭepending on your needs, other solutions are available. Adding devices in operation: a special virtual device has to be added using ifconfig.Prerequisites: you need to enable packet forwarding in your (iptables?) firewall.You cannot setup OpenVPN without root privileges because certain operations requires it. For information about the concept and more examples, refer to the project page. ![]() Please read the man page ( man sshuttle) for the details of options and modes under which sshuttle can run. DNS tunelling is possible with the usage of -H flag. The usage of 0/0 routes all the traffic except DNS requests to the remote server. 0/0 is short for 0.0.0.0/0 that represents the subnets to route over the VPN. r flag denotes the remote hostname and optional username and port that follows in the above example. In this example all internet traffic except DNS is routed through the VPN. For more status messages, run sshuttle in verbose mode with the -v flag. No other details will appear except for a short message and return to shell upon failure. Upon the execution of the command, a sudo password prompt will appear and subsequently the password to SSH account. The basic command for running sshuttle with routing all traffic is: sshuttle -r 0/0 Install sshuttle from the Software Center or the Terminal: sudo apt-get install sshuttle
0 Comments
Read More
Leave a Reply. |