summaryrefslogtreecommitdiffstats
path: root/content/posts/openbsd-vpn-gateway
diff options
context:
space:
mode:
authorDante Catalfamo2020-07-21 22:43:21 -0400
committerDante Catalfamo2020-07-21 22:43:21 -0400
commit10109a0188606cd14c92b5f07f1891b94166df5c (patch)
tree7a6a1364a48e774af9f4045c2897cf9ca5fd028a /content/posts/openbsd-vpn-gateway
parentb29193e38464b3b6eb3062833005f26ee6efe74f (diff)
downloadblog-10109a0188606cd14c92b5f07f1891b94166df5c.tar.gz
blog-10109a0188606cd14c92b5f07f1891b94166df5c.tar.bz2
blog-10109a0188606cd14c92b5f07f1891b94166df5c.zip
gateway: chmod files and rcctl business
Diffstat (limited to 'content/posts/openbsd-vpn-gateway')
-rw-r--r--content/posts/openbsd-vpn-gateway/index.org34
1 files changed, 34 insertions, 0 deletions
diff --git a/content/posts/openbsd-vpn-gateway/index.org b/content/posts/openbsd-vpn-gateway/index.org
index f45a3d7..585a197 100644
--- a/content/posts/openbsd-vpn-gateway/index.org
+++ b/content/posts/openbsd-vpn-gateway/index.org
@@ -155,3 +155,37 @@
#+BEGIN_SRC
auth-user-pass vpnpass.txt
#+END_SRC
+
+ Now we change their permissions to make sure they cannot be read or
+ modified by other users on the system.
+
+ #+BEGIN_SRC shell
+ doas chmod 600 profile.ovpn vpnpasswd.txt
+ #+END_SRC
+
+** rcctl
+
+ We can now set the OpenVPN daemon to launch at boot with our
+ modified profile using =rcctl=. =rcctl= is a tool that comes with
+ OpenBSD which modifies =/etc/rc.conf.local= on your behalf to
+ ensure it's done properly. The use of =rcctl= is not strictly
+ required, but highly recommended.
+
+
+ #+BEGIN_SRC shell
+ doas rcctl set openvpn flags --config /root/profile.ovpn
+ doas rcctl enable openvpn
+ doas rcctl start openvpn
+ #+END_SRC
+
+ - =rcctl set openvpn flags --config /root/profile.ovpn= tells
+ =rcctl= to set the launch flags to the =openvpn= daemon to
+ =--config /root/profile.ovpn=. This is an OpenVPN option that
+ tells it to load its config from =/root/profile.ovpn=.
+
+ - =rcctl enable openvpn=, enables the daemon at boot.
+
+ - =rcctl start openvpn= starts the =openvpn= daemon.
+
+ If things are configured correctly, you should now see a =tun=
+ device in your =ifconfig=.