Enable ssh tunnel to home via systemd
# vi /usr/local/bin/vpntohome.sh
#!/bin/bash
su - vpntohome -c "screen -D -m /home/vpntohome/vpntohome"
# chmod 700 /usr/local/bin/vpntohome.sh
# vi /lib/systemd/system/vpntohome.service
[Unit]
Description=Start SSH tunnel to applesauce
After=syslog.target network.target sshd.service
[Service]
Type=simple
ExecStart=/usr/local/bin/vpntohome.sh
RestartSec=120
[Install]
WantedBy=multi-user.target
# cd /etc/systemd/system/
# ln -s /lib/systemd/system/vpntohome.service vpntohome.service
# systemctl daemon-reload
# systemctl start vpntohome.service
# systemctl enable vpntohome.service
#!/bin/bash
su - vpntohome -c "screen -D -m /home/vpntohome/vpntohome"
# chmod 700 /usr/local/bin/vpntohome.sh
# vi /lib/systemd/system/vpntohome.service
[Unit]
Description=Start SSH tunnel to applesauce
After=syslog.target network.target sshd.service
[Service]
Type=simple
ExecStart=/usr/local/bin/vpntohome.sh
RestartSec=120
[Install]
WantedBy=multi-user.target
# cd /etc/systemd/system/
# ln -s /lib/systemd/system/vpntohome.service vpntohome.service
# systemctl daemon-reload
# systemctl start vpntohome.service
# systemctl enable vpntohome.service
Comments
Post a Comment