歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux基礎 >> 關於Linux >> 用autossh保證ssh隧道穩定性

用autossh保證ssh隧道穩定性

日期:2017/3/1 16:26:22   编辑:關於Linux
用autossh保證ssh隧道穩定性 最近希望建立的ssh隧道可靠,有時候進程仍然在,但是連接已經無效。 autossh是個很好的東西。在Ubuntu下安裝 apt-get install autossh 使用方法很簡單,比如原來直接用ssh的命令: [plain] ssh -N -v -D localhost:8527 root@remote_ssh_server -p remote_ssh_port 現在改成: [plain] autossh -M 5122 -N -v -D localhost:8527 root@remote_ssh_server -p remote_ssh_port 試用後,的確效果很好。 -M 5122是服務器echo機制使用的端口。雖然不太明白用處,但是加上了也不影響工作。
Copyright © Linux教程網 All Rights Reserved