How to Reliably Keep an SSH Tunnel Open in Server?
This article will give you example of how to keep ssh tunnel open. I’m going to show you about ubuntu keep ssh tunnel alive. if you want to see example of server keep alive ssh tunnel then you are a right place. i explained simply step by step how to keep ssh tunnel open. follow bellow step for how to keep ssh connection open example.
We can create ssh tunnel using ssh command, how to keep them alive, so here i will give you simple examples how to create ssh tunnel and keep alive then.
let's see bellow command:
Example 1:
Syntax:
ssh -f -N -L 13307:127.0.0.1:3306 user_name@server_ip
Example:
ssh -f -N -L 13307:127.0.0.1:3306 root@167.111.111.111
Example 2:
Syntax:
autossh -M 20000 -f -N your_public_server -R 1234:localhost:22 -C
Example:
sudo apt-get install autossh
autossh -M 20000 -f -N your_public_server -R 1234:localhost:22 -C
i hope it can help you...
Hardik Savani
I'm a full-stack developer, entrepreneur and owner of ItSolutionstuff.com. I live in India and I love to write tutorials and tips that can help to other artisan. I am a big fan of PHP, Laravel, Angular, Vue, Node, Javascript, JQuery, Codeigniter and Bootstrap from the early stage. I believe in Hardworking and Consistency.
We are Recommending you
- SSH Command to Connect to Server using Pem File Example
- How to Connect to a Remote Server using SSH on Ubuntu?
- Solved - Mysql Out of sort memory, consider increasing server sort buffer size
- How to Change GitHub Remote from HTTPS to SSH?
- Pm2 yarn start server | deploy yarn app using pm2 Example
- How to Connect SSH using PHP?
- Laravel Datatables Server Side Processing Example
- How to Upload File to Linux Server from My Computer?
- How to Resolve Laravel Blank Page on Server?