Public
Authored by 胡小根

配置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
Edited
/etc/rc.local 182 Bytes
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment