<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.css?cache=2026-11-13T15:19:59+00:00" type="text/css"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<html:meta xmlns:html="http://www.w3.org/1999/xhtml" name="viewport" content="width=device-width" />
<channel>
	<title>vpn &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/vpn/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Wed, 25 Sep 2024 07:14:13 +0000</lastBuildDate>
	<language>en-GB</language>
	<copyright>© Terence Eden. 🄯 CC BY-SA. See https://shkspr.mobi/blog/copyright-and-copyleft/</copyright>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.5</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>vpn &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[A quick guide to getting Mozilla VPN working on a headless Linux server]]></title>
		<link>https://shkspr.mobi/blog/2023/03/a-quick-guide-to-getting-mozilla-vpn-working-on-a-headless-linux-server/</link>
					<comments>https://shkspr.mobi/blog/2023/03/a-quick-guide-to-getting-mozilla-vpn-working-on-a-headless-linux-server/#comments</comments>
				<dc:creator><![CDATA[Terence Eden]]></dc:creator>
		<pubDate>Thu, 16 Mar 2023 12:34:56 +0000</pubDate>
		<category><![CDATA[CLI]]></category><category><![CDATA[HowTo]]></category><category><![CDATA[linux]]></category><category><![CDATA[ubuntu]]></category><category><![CDATA[vpn]]></category>		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=45148</guid>

		
		<description>The Mozilla VPN service is great, but it doesn't work using the CLI if you have a "headless" server.  After a bit of faffing about, I got it working.  I suffered so you don't have to.  Get an account  Sign up and use code MOZILLA20 for a cheeky 20% discount!  Get a token in the browser  To start with, you'll need to get an authentication token. This requires you to be on a machine which can run a …</description>
			
		<content:encoded>&lt;p&gt;The &lt;a href="https://www.mozilla.org/en-US/products/vpn/"&gt;Mozilla VPN service&lt;/a&gt; is great, but it &lt;a href="https://github.com/mozilla-mobile/mozilla-vpn-client/issues/6301"&gt;doesn't work using the CLI if you have a "headless" server&lt;/a&gt;.  After a bit of faffing about, I got it working.  I suffered so you don't have to.&lt;/p&gt;

&lt;h2 id="get-an-account"&gt;&lt;a href="https://shkspr.mobi/blog/2023/03/a-quick-guide-to-getting-mozilla-vpn-working-on-a-headless-linux-server/#get-an-account"&gt;Get an account&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://www.mozilla.org/en-US/products/vpn/"&gt;Sign up&lt;/a&gt; and use code &lt;mark&gt;MOZILLA20&lt;/mark&gt; for a cheeky 20% discount!&lt;/p&gt;

&lt;h2 id="get-a-token-in-the-browser"&gt;&lt;a href="https://shkspr.mobi/blog/2023/03/a-quick-guide-to-getting-mozilla-vpn-working-on-a-headless-linux-server/#get-a-token-in-the-browser"&gt;Get a token in the browser&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;To start with, you'll need to get an authentication token. This requires you to be on a machine which can run a modern browser like Firefox or Chrome.&lt;/p&gt;

&lt;p&gt;On a computer with a GUI, download &lt;a href="https://github.com/NilsIrl/MozWire"&gt;MozWire&lt;/a&gt;.  This is an unofficial way to download the necessary WireGuard config files.&lt;/p&gt;

&lt;p&gt;Open up a terminal and make it executable:&lt;/p&gt;

&lt;pre&gt;chmod +x mozwire-linux&lt;/pre&gt;

&lt;p&gt;Run the app:&lt;/p&gt;

&lt;pre&gt;./mozwire-linux --print-token&lt;/pre&gt;

&lt;p&gt;That will automatically open your web browser. Sign in to the Mozilla VPN service in the browser. Return to your terminal and you'll see a long token like:&lt;/p&gt;

&lt;pre&gt;abc.123.qwe.rty.uio&lt;/pre&gt;

&lt;p&gt;It will be &lt;em&gt;much&lt;/em&gt; longer than that! Save it somewhere safe.&lt;/p&gt;

&lt;h2 id="server-time"&gt;&lt;a href="https://shkspr.mobi/blog/2023/03/a-quick-guide-to-getting-mozilla-vpn-working-on-a-headless-linux-server/#server-time"&gt;Server time!&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;SSH into your server.  Download &lt;a href="https://github.com/NilsIrl/MozWire"&gt;MozWire&lt;/a&gt;.&lt;/p&gt;

&lt;pre&gt;wget https://github.com/NilsIrl/MozWire/releases/latest/download/mozwire-linux&lt;/pre&gt;

&lt;p&gt;Make it executable:&lt;/p&gt;

&lt;pre&gt;chmod +x mozwire-linux&lt;/pre&gt;

&lt;p&gt;Check that it works by getting it to list all the devices you have associated with your account:&lt;/p&gt;

&lt;pre&gt;./mozwire-linux --token abc.123.qwe.rty.uio device list&lt;/pre&gt;

&lt;p&gt;That should show the name of your devices - it &lt;em&gt;won't&lt;/em&gt; include the server.&lt;/p&gt;

&lt;p&gt;It's tedious to type in the token each time, so run:&lt;/p&gt;

&lt;pre&gt;export MOZ_TOKEN="abc.123.qwe.rty.uio"&lt;/pre&gt;

&lt;p&gt;Run:&lt;/p&gt;

&lt;pre&gt;./mozwire-linux device list&lt;/pre&gt;

&lt;p&gt;And you should get the same result as before.&lt;/p&gt;

&lt;p&gt;Make sure you have installed WireGuard and resolvconf:&lt;/p&gt;

&lt;pre&gt;sudo apt install wireguard wireguard-tools resolvconf&lt;/pre&gt;

&lt;p&gt;Next, generate the public/private keypair and associate it with your server:&lt;/p&gt;

&lt;pre&gt;./mozwire-linux device add --name My-Awesome-Server --privkey $(wg genkey)&lt;/pre&gt;

&lt;p&gt;Once that's run, you can confirm the server has been added by again running:&lt;/p&gt;

&lt;pre&gt;./mozwire-linux device list&lt;/pre&gt;

&lt;p&gt;That should show your previous devices &lt;em&gt;and&lt;/em&gt; the new one.&lt;/p&gt;

&lt;p&gt;Next up, it's time to download all the Mozilla VPN WireGuard configs:&lt;/p&gt;

&lt;pre&gt;./mozwire-linux relay save -o ~/mozwireconf -n 0&lt;/pre&gt;

&lt;p&gt;That will upload your public key to Mozilla and then download a bunch of configurations into &lt;code&gt;~/mozwireconf&lt;/code&gt; (or wherever you choose).&lt;/p&gt;

&lt;h2 id="run-wireguard"&gt;&lt;a href="https://shkspr.mobi/blog/2023/03/a-quick-guide-to-getting-mozilla-vpn-working-on-a-headless-linux-server/#run-wireguard"&gt;Run Wireguard&lt;/a&gt;&lt;/h2&gt;

&lt;p&gt;To connect to, say, the Denmark Copenhagen server, run:&lt;/p&gt;

&lt;pre&gt;wg-quick up ~/mozwireconf/dk-cph-wg-101.conf&lt;/pre&gt;

&lt;p&gt;And... that's it! If you run &lt;code&gt;ifconfig&lt;/code&gt; you'll see a new network entry for WireGuard.&lt;/p&gt;

&lt;p&gt;You can check that it's working by running:&lt;/p&gt;

&lt;pre&gt;curl https://ifconfig.co/json ; echo&lt;/pre&gt;

&lt;p&gt;That will print out some diagnostic information about the IP address your server presents to the world.&lt;/p&gt;

&lt;p&gt;To turn off the MozillaVPN, run:&lt;/p&gt;

&lt;pre&gt;wg-quick down ~/mozwireconf/dk-cph-wg-101.conf&lt;/pre&gt;

&lt;p&gt;To run MozillaVPN for a single program, install &lt;a href="https://github.com/jamesmcm/vopono/"&gt;Vopono&lt;/a&gt;&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-_"&gt;vopono exec --custom ~/.config/vopono/mozilla/wireguard/fi-hel-wg-103.conf "curl https://ifconfig.co/json"
&lt;/code&gt;&lt;/pre&gt;
&lt;img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=45148&amp;amp;HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager"&gt;</content:encoded>
	

					<wfw:commentRss>https://shkspr.mobi/blog/2023/03/a-quick-guide-to-getting-mozilla-vpn-working-on-a-headless-linux-server/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Cisco AnyConnect for Linux - save profile]]></title>
		<link>https://shkspr.mobi/blog/2020/09/cisco-anyconnect-for-linux-save-profile/</link>
					<comments>https://shkspr.mobi/blog/2020/09/cisco-anyconnect-for-linux-save-profile/#comments</comments>
				<dc:creator><![CDATA[Terence Eden]]></dc:creator>
		<pubDate>Fri, 25 Sep 2020 11:05:47 +0000</pubDate>
		<category><![CDATA[HowTo]]></category><category><![CDATA[linux]]></category><category><![CDATA[vpn]]></category>		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=36392</guid>

		
		<description>I couldn't find a simple guide to this - so these are notes to myself.  Create a file called myVPN.xml:  &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/"                    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"                    xsi:schemaLocation="http://schemas.xmlsoap.org/encoding/AnyConnectProfile.xsd"&gt;    &lt;ServerList&gt;     …</description>
			
		<content:encoded>&lt;p&gt;I couldn't find a simple guide to this - so these are notes to myself.&lt;/p&gt;

&lt;p&gt;Create a file called &lt;code&gt;myVPN.xml&lt;/code&gt;:&lt;/p&gt;

&lt;pre&gt;&lt;code class="language-xml"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;AnyConnectProfile xmlns="http://schemas.xmlsoap.org/encoding/"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://schemas.xmlsoap.org/encoding/AnyConnectProfile.xsd"&amp;gt;
   &amp;lt;ServerList&amp;gt;
      &amp;lt;HostEntry&amp;gt;
         &amp;lt;HostName&amp;gt;My Work VPN&amp;lt;/HostName&amp;gt;    
         &amp;lt;HostAddress&amp;gt;vpn.example.com/connect&amp;lt;/HostAddress&amp;gt;
      &amp;lt;/HostEntry&amp;gt;
   &amp;lt;/ServerList&amp;gt;
&amp;lt;/AnyConnectProfile&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Place it in &lt;code&gt;/opt/cisco/anyconnect/profile/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now, when you launch your VPN client, it will show you your saved hosts.&lt;/p&gt;

&lt;p&gt;Huge thanks to &lt;a href="https://www.linkedin.com/in/alexander-monk/"&gt;Alex Monk&lt;/a&gt; for showing me the way!&lt;/p&gt;
&lt;img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=36392&amp;amp;HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager"&gt;</content:encoded>
	

					<wfw:commentRss>https://shkspr.mobi/blog/2020/09/cisco-anyconnect-for-linux-save-profile/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
	</channel>
</rss>
