配置autossh开机启动
以下脚本以Ubuntu 18.04为例.
1. 创建文件/etc/systemd/system/rc-local.service
[Unit]
Description=/etc/rc.local Compatibility
ConditionPathExists=/etc/rc.local
[Service]
Type=forking
ExecStart=/etc/rc.local start
TimeoutSec=0
StandardOutput=tty
RemainAfterExit=yes
[Install]
WantedBy=multi-user.target
2. 创建完文件/etc/rc.local之后,需要执行以下命令:
chown root:root /etc/rc.local
chmod 755 /etc/rc.local
systemctl enable rc-local.service
Please register or sign in to comment