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

Comments

Popular posts from this blog

Xubuntu Home Server on Dell XPS 13 9370

Cygwin + syslog-ng

Installing Fedora 21 on a (late 2014) Mac Mini