[问题] autossh 开机自动

楼主: yshihyu (yshihyu)   2017-07-07 19:00:29
我家里电脑在 ~/.profile 底下加上下面指令可以成功建起 tunnel
nohup autossh -M 23456 -NfR 8888:localhost:22 [email protected]/*
作者: kenduest (小州)   2017-07-07 19:02:00
.profile 那是个人登入时候会执行的脚本档案应该不会有所谓开机时候自己启动这个功能不过也许你的系统有开机时候启动X,有自动登入该帐号这类或许可能会执行到?纯个人猜测
作者: dearlove (初现)   2017-07-07 19:05:00
写在 /etc/rc.local
作者: kenduest (小州)   2017-07-07 19:09:00
/etc/rc.local 之外,若你系统是使用新的 linux 版本有采用 systemd 的话可采用他的运作额外配置方式
作者: chang505 (眼线)   2017-07-07 19:47:00
自写看门狗丢在crontab就好
作者: qsort (Cos)   2017-07-11 21:26:00
autossh不是ssh,autossh要是需要ssh来连线,只是autossh会检查ssh结束的return code,再决定要不要重叫ssh建议不要用autossh -M的功能,改用ssh ServerAliveInterval和ServerAliveCountMax,这个透过ssh session tunnel做pingpong test, 优点: 少用两个port, 可以透过strace看ssh是否nohup也不需要了,autossh有-f可以直接丢背景但一定要配合和ssh的-N和key-based authentication例如: autossh -f -N -o ServerAliveInterval=15 ip.ip.ip.注意: -f的位置一定要出现在ssh的参数之前"man ssh_config"有说明ServerAliveInterval的用法
继续阅读
[闲聊] RedHat 7qoooooooo123[问题] ubuntu 16.04 Macbook pro FN key问题chengreg[问题] 笔电外接萤幕owem0410[问题] VMware CentOS7 网络问题clv[问题] [email protected]

Links booklink

Contact Us: admin [ a t ] ucptt.com