Sometimes back to SSH tunnel, the manual use of SSH to create these is not too big a problem, but if you try to boot, write a shell script and run the script in Rc.local is not successful, the reason is not known.
Later discovered autossh this thing, not only can create SSH tunnel silent mode can also set automatic detection, and automatically try to link the options.
The script that is provided in the attachment of this article needs to be placed in the/etc/ini.d/directory and modified with chmod +x permissions. It is then also necessary to use UPDATE-RC.D service defaults to add the boot service to the boot.
Of course, don't forget to modify the configuration information in the script.
You can then automatically create SSH tunnel at boot time. Enjoy it.
This article is from the "EIT Tramp" blog, please be sure to keep this source http://zicowarn.blog.51cto.com/3815716/1653601
Use Autossh to implement the method of creating SSH tunnel on boot and shell script.