https://github.com/stefansundin/ssh-tunnel-proxy
Program that automatically opens SSH tunnels when connections are received.
https://github.com/stefansundin/ssh-tunnel-proxy
Last synced: 7 months ago
JSON representation
Program that automatically opens SSH tunnels when connections are received.
- Host: GitHub
- URL: https://github.com/stefansundin/ssh-tunnel-proxy
- Owner: stefansundin
- License: gpl-3.0
- Created: 2017-11-12T07:01:54.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2020-04-20T01:53:06.000Z (over 5 years ago)
- Last Synced: 2024-10-11T00:54:59.261Z (12 months ago)
- Language: Ruby
- Homepage:
- Size: 50.8 KB
- Stars: 6
- Watchers: 0
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ssh-tunnel-proxy
This is a fairly simple program that does the following:
- Opens TCP servers on startup.
- Upon receiving a connection, the program opens the SSH connection to the destination server, and forwards the connection.
- The first connection takes a few seconds as the SSH connection is established.
- Subsequent connections are fast as the SSH connection is still open.
- After 5 minutes of inactivity with no open connections, the SSH connection is closed.
- Consumes negligible resources when idle.See [ssh-tunnel-proxy.toml](ssh-tunnel-proxy.toml) for configuration examples.
# Install
### Mac
On Mac with Homebrew:
```bash
brew install stefansundin/tap/ssh-tunnel-proxy
BUNDLE_GEMFILE=$(brew --prefix)/opt/ssh-tunnel-proxy/libexec/Gemfile bundle install
```Note: The service assumes that you are using rbenv, but you can easily change that.
### Debian/Ubuntu
```
sudo apt-get install apt-transport-https
curl -fsS https://stefansundin.github.io/deb/stefansundin.asc | sudo apt-key add -
echo "deb https://stefansundin.github.io/deb /" | sudo tee /etc/apt/sources.list.d/stefansundin.list
sudo apt-get update
sudo apt-get install -y ssh-tunnel-proxy
sudo systemctl enable ssh-tunnel-proxy
```Please note that the systemd service will try to load the configuration from `/etc/ssh-tunnel-proxy.toml`, and you will not be able to use `~` in paths, and you have to manually specify the location of your ssh keys.
# Troubleshooting
If you have a lot of tunnels, then you will eventually need to increase the file descriptor limit:
```
# run before you start the program:
ulimit -n 4096
```