SSH Tunnel Keeper is a simple Bash script to keep a SOCKS5 proxy tunnel via SSH alive, automatically reconnecting when the connection drops.
- Keeps an SSH SOCKS5 tunnel running in the background
- Automatically reconnects if the SSH connection is lost
- Ensures
ssh
andsshpass
are installed before execution
ssh
sshpass
Make sure you have ssh
and sshpass
installed. You can install them using:
sudo apt update && sudo apt install -y openssh-client sshpass
sudo yum install -y openssh-clients sshpass
sudo pacman -Sy openssh sshpass
-
Clone this repository:
git clone https://github.com/yourusername/ssh-tunnel-keeper.git cd ssh-tunnel-keeper
-
Edit the script to replace
******
with your SSH password and server details. -
Run the script:
chmod +x ssh_tunnel_keeper.sh ./ssh_tunnel_keeper.sh
MIT License
Copyright 2025, Max Base