Skip to content

Instantly share code, notes, and snippets.

@tsuchm
Last active July 8, 2022 02:08
Show Gist options
  • Save tsuchm/2d26f23246ee1253e61ef6d16fe96674 to your computer and use it in GitHub Desktop.
Save tsuchm/2d26f23246ee1253e61ef6d16fe96674 to your computer and use it in GitHub Desktop.
Systemd unit file to establish VPN with sshuttle command
# (0) Replace the gateway server name and the subnet address with your own values.
# (1) Put this file into ~/.config/systemd/user/sshuttle.service
# (2) Invoke `systemctl --user daemon-reload`
# (3) Invoke `systemctl --user start sshuttle.service`
[Unit]
Description=sshuttle
Requires=gpg-agent-ssh.socket
After=gpg-agent-ssh.socket
[Service]
Type=simple
Environment=SSH_AUTH_SOCK=/run/user/%U/gnupg/S.gpg-agent.ssh
ExecStart=/usr/bin/sshuttle --remote=ssh-gateway-server.example.jp 198.51.100.0/24
[Install]
WantedBy=default.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment