<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.softwareheritage.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vsellier</id>
	<title>Software Heritage Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.softwareheritage.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Vsellier"/>
	<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/wiki/Special:Contributions/Vsellier"/>
	<updated>2026-11-03T20:47:54Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.17</generator>
	<entry>
		<id>https://wiki.softwareheritage.org/index.php?title=VPN&amp;diff=1599</id>
		<title>VPN</title>
		<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=VPN&amp;diff=1599"/>
		<updated>2021-07-09T10:28:22Z</updated>

		<summary type="html">&lt;p&gt;Vsellier: /* /etc/hosts entries */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[Software Heritage]] server and the VMs running on it are severely firewalled.&lt;br /&gt;
To get onto their network unrestricted, a VPN based on [https://openvpn.net/ OpenVPN] is available.&lt;br /&gt;
&lt;br /&gt;
The setup is client-server, with per-client certificates.&lt;br /&gt;
&lt;br /&gt;
== OpenVPN client configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Raw OpenVPN ===&lt;br /&gt;
&lt;br /&gt;
Sample configuration file, e.g., /etc/openvpn/swh.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
remote vpn.softwareheritage.org&lt;br /&gt;
ns-cert-type server &lt;br /&gt;
comp-lzo &lt;br /&gt;
nobind&lt;br /&gt;
dev tun&lt;br /&gt;
proto udp &lt;br /&gt;
port 1194 &lt;br /&gt;
log /var/log/openvpn.log&lt;br /&gt;
up-restart &lt;br /&gt;
persist-key &lt;br /&gt;
persist-tun &lt;br /&gt;
client &lt;br /&gt;
ca /etc/openvpn/keys/softwareheritage-ca.crt&lt;br /&gt;
cert /etc/openvpn/keys/softwareheritage.crt&lt;br /&gt;
key /etc/openvpn/keys/softwareheritage.key&lt;br /&gt;
user nobody&lt;br /&gt;
group nogroup&lt;br /&gt;
&lt;br /&gt;
# If you are using resolvconf, add this:&lt;br /&gt;
# Make sure you add louvre to /etc/hosts to avoid issues in using the vpn-provided DNS server.&lt;br /&gt;
script-security 2&lt;br /&gt;
up /etc/openvpn/update-resolv-conf&lt;br /&gt;
down /etc/openvpn/update-resolv-conf&lt;br /&gt;
&lt;br /&gt;
# If you want the connection to persist when your network fails, add this:&lt;br /&gt;
ping-restart 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to the above configuration file, you will need to install the following 3 files under /etc/openvpn/keys (matching the paths within the sample above):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[softwareheritage-ca.crt]]&#039;&#039;&#039;: &#039;&#039;public&#039;&#039; certificate for the Software Heritage certification authority (CA)&lt;br /&gt;
* &#039;&#039;&#039;[https://wiki.softwareheritage.org/index.php?title=VPN#For_admins softwareheritage.crt]&#039;&#039;&#039;: &#039;&#039;public&#039;&#039;, client-specific (certificate signed by the admin, see below)&lt;br /&gt;
* &#039;&#039;&#039;[https://wiki.softwareheritage.org/wiki/VPN#For_users softwareheritage.key]&#039;&#039;&#039;: &#039;&#039;private&#039;&#039;, client-specific key (generated by the user, see below)&lt;br /&gt;
&lt;br /&gt;
Activate the openvpn server&lt;br /&gt;
&lt;br /&gt;
as root, run&lt;br /&gt;
&lt;br /&gt;
   systemctl enable openvpn@swh.service&lt;br /&gt;
   systemctl start openvpn@swh.service&lt;br /&gt;
   systemctl status openvpn@swh.service&lt;br /&gt;
&lt;br /&gt;
Note: Internally, the `swh` must match the /etc/openvpn/swh.conf filename.&lt;br /&gt;
&lt;br /&gt;
Excerpt of a successful start:&lt;br /&gt;
&lt;br /&gt;
  root@machine:~# systemctl status openvpn@swh.service&lt;br /&gt;
  openvpn@swh.service - OpenVPN connection to swh&lt;br /&gt;
   Loaded: loaded (/lib/systemd/system/openvpn@.service; indirect; vendor preset: enabled)&lt;br /&gt;
   Active: active (running) since Thu 2020-12-17 19:03:29 IST; 22min ago&lt;br /&gt;
     Docs: man:openvpn(8)&lt;br /&gt;
           https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage&lt;br /&gt;
           https://community.openvpn.net/openvpn/wiki/HOWTO&lt;br /&gt;
 Main PID: 12302 (openvpn)&lt;br /&gt;
   Status: &amp;quot;Initialization Sequence Completed&amp;quot;&lt;br /&gt;
    Tasks: 1 (limit: 4915)&lt;br /&gt;
   CGroup: /system.slice/system-openvpn.slice/openvpn@swh.service&lt;br /&gt;
           └─12302 /usr/sbin/openvpn --daemon ovpn-swh --status /run/openvpn/swh.status 10 --cd /etc/openvpn --script-security 2 --config /etc/openvpn/swh.conf --writepid /run/openvpn/swh.pid&lt;br /&gt;
&lt;br /&gt;
Dec 17 19:03:29 machine systemd[1]: Starting OpenVPN connection to swh...&lt;br /&gt;
Dec 17 19:03:29 machine systemd[1]: Started OpenVPN connection to swh.&lt;br /&gt;
&lt;br /&gt;
=== Network Manager GUI ===&lt;br /&gt;
&lt;br /&gt;
You need network-manager-openvpn and network-manager-openvpn-gnome for the configuration gui.&lt;br /&gt;
&lt;br /&gt;
[[File:nm_openvpn_base.png]]&lt;br /&gt;
[[File:nm_openvpn_routes.png]]&lt;br /&gt;
[[File:nm_openvpn_advanced_general.png]]&lt;br /&gt;
[[File:nm_openvpn_advanced_security.png]]&lt;br /&gt;
[[File:nm_openvpn_advanced_tls_auth.png]]&lt;br /&gt;
&lt;br /&gt;
== Obtaining a client certificate ==&lt;br /&gt;
&lt;br /&gt;
=== For users ===&lt;br /&gt;
&lt;br /&gt;
Generate a keypair (key + certificate signing request) using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
openssl req -new -newkey rsa:2048 -nodes -keyout openvpn.key -out openvpn.csr -subj &amp;quot;/CN=&amp;lt;your username&amp;gt;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please replace &amp;lt;your username&amp;gt; with something that uniquely identifies the certificate.&lt;br /&gt;
&lt;br /&gt;
Make sure openvpn.key is stored in a safe place (it&#039;s your private key, which will allow anyone to connect to the VPN).&lt;br /&gt;
&lt;br /&gt;
Provide the CSR file to a sysadmin through a reasonably authenticated medium.&lt;br /&gt;
&lt;br /&gt;
=== For admins ===&lt;br /&gt;
&lt;br /&gt;
* On the firewall (192.168.50.1), go to the [https://192.168.50.1/system_certmanager.php System / Trust / Certificates page]&lt;br /&gt;
* click on the add button on the upper right&lt;br /&gt;
[[File:Vpn-main-trust-page.png]]&lt;br /&gt;
* On the Method list, choose &amp;quot;Sign a certificate Signing Request&amp;quot;&lt;br /&gt;
[[File:Vpn-csr-signing.png]]&lt;br /&gt;
&lt;br /&gt;
Fetch the CSR file provided by the user, for instance with &amp;lt;tt&amp;gt;scp USERNAME.csr louvre:&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Enter the user name on the descriptive name&lt;br /&gt;
* Select &amp;quot;OpenVPN Software Heritage (louvre)&amp;quot; as Certificate Authority&lt;br /&gt;
* Enter the duration, usually 10 years&lt;br /&gt;
* Paste the csr &lt;br /&gt;
* Validate&lt;br /&gt;
&lt;br /&gt;
* check the details of the csr and validate&lt;br /&gt;
&lt;br /&gt;
== Revoking a client certificate ==&lt;br /&gt;
&lt;br /&gt;
On the firewall (master) [https://192.168.50.1]:&lt;br /&gt;
* go to the [[https://192.168.50.1/system_crlmanager.php System / Trust / Revocation]] page&lt;br /&gt;
* edit the &amp;quot;OpenVPN certificate revocation list&amp;quot; CRL&lt;br /&gt;
&lt;br /&gt;
[[File:Vpn-crl-list.png]]&lt;br /&gt;
&lt;br /&gt;
* go to the bottom of the page&lt;br /&gt;
&lt;br /&gt;
[[File:Vpn-csr-certificate.png]]&lt;br /&gt;
&lt;br /&gt;
* select the certificate to revoke&lt;br /&gt;
* Add&lt;br /&gt;
&lt;br /&gt;
The counter of revoked certificate should be increased by one on for the OpenVPN CSR on the CSR list&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:Infrastructure]]&lt;br /&gt;
[[Category:System administration]]&lt;/div&gt;</summary>
		<author><name>Vsellier</name></author>
	</entry>
	<entry>
		<id>https://wiki.softwareheritage.org/index.php?title=VPN&amp;diff=1598</id>
		<title>VPN</title>
		<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=VPN&amp;diff=1598"/>
		<updated>2021-07-09T10:23:18Z</updated>

		<summary type="html">&lt;p&gt;Vsellier: /* Revoking a client certificate */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[Software Heritage]] server and the VMs running on it are severely firewalled.&lt;br /&gt;
To get onto their network unrestricted, a VPN based on [https://openvpn.net/ OpenVPN] is available.&lt;br /&gt;
&lt;br /&gt;
The setup is client-server, with per-client certificates.&lt;br /&gt;
&lt;br /&gt;
== OpenVPN client configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Raw OpenVPN ===&lt;br /&gt;
&lt;br /&gt;
Sample configuration file, e.g., /etc/openvpn/swh.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
remote vpn.softwareheritage.org&lt;br /&gt;
ns-cert-type server &lt;br /&gt;
comp-lzo &lt;br /&gt;
nobind&lt;br /&gt;
dev tun&lt;br /&gt;
proto udp &lt;br /&gt;
port 1194 &lt;br /&gt;
log /var/log/openvpn.log&lt;br /&gt;
up-restart &lt;br /&gt;
persist-key &lt;br /&gt;
persist-tun &lt;br /&gt;
client &lt;br /&gt;
ca /etc/openvpn/keys/softwareheritage-ca.crt&lt;br /&gt;
cert /etc/openvpn/keys/softwareheritage.crt&lt;br /&gt;
key /etc/openvpn/keys/softwareheritage.key&lt;br /&gt;
user nobody&lt;br /&gt;
group nogroup&lt;br /&gt;
&lt;br /&gt;
# If you are using resolvconf, add this:&lt;br /&gt;
# Make sure you add louvre to /etc/hosts to avoid issues in using the vpn-provided DNS server.&lt;br /&gt;
script-security 2&lt;br /&gt;
up /etc/openvpn/update-resolv-conf&lt;br /&gt;
down /etc/openvpn/update-resolv-conf&lt;br /&gt;
&lt;br /&gt;
# If you want the connection to persist when your network fails, add this:&lt;br /&gt;
ping-restart 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to the above configuration file, you will need to install the following 3 files under /etc/openvpn/keys (matching the paths within the sample above):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[softwareheritage-ca.crt]]&#039;&#039;&#039;: &#039;&#039;public&#039;&#039; certificate for the Software Heritage certification authority (CA)&lt;br /&gt;
* &#039;&#039;&#039;[https://wiki.softwareheritage.org/index.php?title=VPN#For_admins softwareheritage.crt]&#039;&#039;&#039;: &#039;&#039;public&#039;&#039;, client-specific (certificate signed by the admin, see below)&lt;br /&gt;
* &#039;&#039;&#039;[https://wiki.softwareheritage.org/wiki/VPN#For_users softwareheritage.key]&#039;&#039;&#039;: &#039;&#039;private&#039;&#039;, client-specific key (generated by the user, see below)&lt;br /&gt;
&lt;br /&gt;
Activate the openvpn server&lt;br /&gt;
&lt;br /&gt;
as root, run&lt;br /&gt;
&lt;br /&gt;
   systemctl enable openvpn@swh.service&lt;br /&gt;
   systemctl start openvpn@swh.service&lt;br /&gt;
   systemctl status openvpn@swh.service&lt;br /&gt;
&lt;br /&gt;
Note: Internally, the `swh` must match the /etc/openvpn/swh.conf filename.&lt;br /&gt;
&lt;br /&gt;
Excerpt of a successful start:&lt;br /&gt;
&lt;br /&gt;
  root@machine:~# systemctl status openvpn@swh.service&lt;br /&gt;
  openvpn@swh.service - OpenVPN connection to swh&lt;br /&gt;
   Loaded: loaded (/lib/systemd/system/openvpn@.service; indirect; vendor preset: enabled)&lt;br /&gt;
   Active: active (running) since Thu 2020-12-17 19:03:29 IST; 22min ago&lt;br /&gt;
     Docs: man:openvpn(8)&lt;br /&gt;
           https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage&lt;br /&gt;
           https://community.openvpn.net/openvpn/wiki/HOWTO&lt;br /&gt;
 Main PID: 12302 (openvpn)&lt;br /&gt;
   Status: &amp;quot;Initialization Sequence Completed&amp;quot;&lt;br /&gt;
    Tasks: 1 (limit: 4915)&lt;br /&gt;
   CGroup: /system.slice/system-openvpn.slice/openvpn@swh.service&lt;br /&gt;
           └─12302 /usr/sbin/openvpn --daemon ovpn-swh --status /run/openvpn/swh.status 10 --cd /etc/openvpn --script-security 2 --config /etc/openvpn/swh.conf --writepid /run/openvpn/swh.pid&lt;br /&gt;
&lt;br /&gt;
Dec 17 19:03:29 machine systemd[1]: Starting OpenVPN connection to swh...&lt;br /&gt;
Dec 17 19:03:29 machine systemd[1]: Started OpenVPN connection to swh.&lt;br /&gt;
&lt;br /&gt;
=== Network Manager GUI ===&lt;br /&gt;
&lt;br /&gt;
You need network-manager-openvpn and network-manager-openvpn-gnome for the configuration gui.&lt;br /&gt;
&lt;br /&gt;
[[File:nm_openvpn_base.png]]&lt;br /&gt;
[[File:nm_openvpn_routes.png]]&lt;br /&gt;
[[File:nm_openvpn_advanced_general.png]]&lt;br /&gt;
[[File:nm_openvpn_advanced_security.png]]&lt;br /&gt;
[[File:nm_openvpn_advanced_tls_auth.png]]&lt;br /&gt;
&lt;br /&gt;
== Obtaining a client certificate ==&lt;br /&gt;
&lt;br /&gt;
=== For users ===&lt;br /&gt;
&lt;br /&gt;
Generate a keypair (key + certificate signing request) using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
openssl req -new -newkey rsa:2048 -nodes -keyout openvpn.key -out openvpn.csr -subj &amp;quot;/CN=&amp;lt;your username&amp;gt;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please replace &amp;lt;your username&amp;gt; with something that uniquely identifies the certificate.&lt;br /&gt;
&lt;br /&gt;
Make sure openvpn.key is stored in a safe place (it&#039;s your private key, which will allow anyone to connect to the VPN).&lt;br /&gt;
&lt;br /&gt;
Provide the CSR file to a sysadmin through a reasonably authenticated medium.&lt;br /&gt;
&lt;br /&gt;
=== For admins ===&lt;br /&gt;
&lt;br /&gt;
* On the firewall (192.168.50.1), go to the [https://192.168.50.1/system_certmanager.php System / Trust / Certificates page]&lt;br /&gt;
* click on the add button on the upper right&lt;br /&gt;
[[File:Vpn-main-trust-page.png]]&lt;br /&gt;
* On the Method list, choose &amp;quot;Sign a certificate Signing Request&amp;quot;&lt;br /&gt;
[[File:Vpn-csr-signing.png]]&lt;br /&gt;
&lt;br /&gt;
Fetch the CSR file provided by the user, for instance with &amp;lt;tt&amp;gt;scp USERNAME.csr louvre:&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Enter the user name on the descriptive name&lt;br /&gt;
* Select &amp;quot;OpenVPN Software Heritage (louvre)&amp;quot; as Certificate Authority&lt;br /&gt;
* Enter the duration, usually 10 years&lt;br /&gt;
* Paste the csr &lt;br /&gt;
* Validate&lt;br /&gt;
&lt;br /&gt;
* check the details of the csr and validate&lt;br /&gt;
&lt;br /&gt;
== Revoking a client certificate ==&lt;br /&gt;
&lt;br /&gt;
On the firewall (master) [https://192.168.50.1]:&lt;br /&gt;
* go to the [[https://192.168.50.1/system_crlmanager.php System / Trust / Revocation]] page&lt;br /&gt;
* edit the &amp;quot;OpenVPN certificate revocation list&amp;quot; CRL&lt;br /&gt;
&lt;br /&gt;
[[File:Vpn-crl-list.png]]&lt;br /&gt;
&lt;br /&gt;
* go to the bottom of the page&lt;br /&gt;
&lt;br /&gt;
[[File:Vpn-csr-certificate.png]]&lt;br /&gt;
&lt;br /&gt;
* select the certificate to revoke&lt;br /&gt;
* Add&lt;br /&gt;
&lt;br /&gt;
The counter of revoked certificate should be increased by one on for the OpenVPN CSR on the CSR list&lt;br /&gt;
&lt;br /&gt;
== /etc/hosts entries ==&lt;br /&gt;
&lt;br /&gt;
Once the Vpn is setup on your machine, you can access Software Heritage hosts via their private IP addresses; see [[Network configuration]].&lt;br /&gt;
&lt;br /&gt;
OpenVPN now pushes the address of our DNS server (192.168.100.29, pergamon).&lt;br /&gt;
&lt;br /&gt;
You might want to add louvre.softwareheritage.org in your /etc/hosts to avoid a bootstrap problem if the &amp;quot;on-vpn&amp;quot; DNS server is in your resolv.conf.&lt;br /&gt;
&lt;br /&gt;
[[Category:Infrastructure]]&lt;br /&gt;
[[Category:System administration]]&lt;/div&gt;</summary>
		<author><name>Vsellier</name></author>
	</entry>
	<entry>
		<id>https://wiki.softwareheritage.org/index.php?title=File:Vpn-csr-certificate.png&amp;diff=1597</id>
		<title>File:Vpn-csr-certificate.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=File:Vpn-csr-certificate.png&amp;diff=1597"/>
		<updated>2021-07-09T10:21:01Z</updated>

		<summary type="html">&lt;p&gt;Vsellier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vsellier</name></author>
	</entry>
	<entry>
		<id>https://wiki.softwareheritage.org/index.php?title=File:Vpn-crl-list.png&amp;diff=1596</id>
		<title>File:Vpn-crl-list.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=File:Vpn-crl-list.png&amp;diff=1596"/>
		<updated>2021-07-09T10:19:04Z</updated>

		<summary type="html">&lt;p&gt;Vsellier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vsellier</name></author>
	</entry>
	<entry>
		<id>https://wiki.softwareheritage.org/index.php?title=VPN&amp;diff=1595</id>
		<title>VPN</title>
		<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=VPN&amp;diff=1595"/>
		<updated>2021-07-09T10:12:53Z</updated>

		<summary type="html">&lt;p&gt;Vsellier: /* For admins */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The [[Software Heritage]] server and the VMs running on it are severely firewalled.&lt;br /&gt;
To get onto their network unrestricted, a VPN based on [https://openvpn.net/ OpenVPN] is available.&lt;br /&gt;
&lt;br /&gt;
The setup is client-server, with per-client certificates.&lt;br /&gt;
&lt;br /&gt;
== OpenVPN client configuration ==&lt;br /&gt;
&lt;br /&gt;
=== Raw OpenVPN ===&lt;br /&gt;
&lt;br /&gt;
Sample configuration file, e.g., /etc/openvpn/swh.conf:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
remote vpn.softwareheritage.org&lt;br /&gt;
ns-cert-type server &lt;br /&gt;
comp-lzo &lt;br /&gt;
nobind&lt;br /&gt;
dev tun&lt;br /&gt;
proto udp &lt;br /&gt;
port 1194 &lt;br /&gt;
log /var/log/openvpn.log&lt;br /&gt;
up-restart &lt;br /&gt;
persist-key &lt;br /&gt;
persist-tun &lt;br /&gt;
client &lt;br /&gt;
ca /etc/openvpn/keys/softwareheritage-ca.crt&lt;br /&gt;
cert /etc/openvpn/keys/softwareheritage.crt&lt;br /&gt;
key /etc/openvpn/keys/softwareheritage.key&lt;br /&gt;
user nobody&lt;br /&gt;
group nogroup&lt;br /&gt;
&lt;br /&gt;
# If you are using resolvconf, add this:&lt;br /&gt;
# Make sure you add louvre to /etc/hosts to avoid issues in using the vpn-provided DNS server.&lt;br /&gt;
script-security 2&lt;br /&gt;
up /etc/openvpn/update-resolv-conf&lt;br /&gt;
down /etc/openvpn/update-resolv-conf&lt;br /&gt;
&lt;br /&gt;
# If you want the connection to persist when your network fails, add this:&lt;br /&gt;
ping-restart 10&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
In addition to the above configuration file, you will need to install the following 3 files under /etc/openvpn/keys (matching the paths within the sample above):&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;&#039;[[softwareheritage-ca.crt]]&#039;&#039;&#039;: &#039;&#039;public&#039;&#039; certificate for the Software Heritage certification authority (CA)&lt;br /&gt;
* &#039;&#039;&#039;[https://wiki.softwareheritage.org/index.php?title=VPN#For_admins softwareheritage.crt]&#039;&#039;&#039;: &#039;&#039;public&#039;&#039;, client-specific (certificate signed by the admin, see below)&lt;br /&gt;
* &#039;&#039;&#039;[https://wiki.softwareheritage.org/wiki/VPN#For_users softwareheritage.key]&#039;&#039;&#039;: &#039;&#039;private&#039;&#039;, client-specific key (generated by the user, see below)&lt;br /&gt;
&lt;br /&gt;
Activate the openvpn server&lt;br /&gt;
&lt;br /&gt;
as root, run&lt;br /&gt;
&lt;br /&gt;
   systemctl enable openvpn@swh.service&lt;br /&gt;
   systemctl start openvpn@swh.service&lt;br /&gt;
   systemctl status openvpn@swh.service&lt;br /&gt;
&lt;br /&gt;
Note: Internally, the `swh` must match the /etc/openvpn/swh.conf filename.&lt;br /&gt;
&lt;br /&gt;
Excerpt of a successful start:&lt;br /&gt;
&lt;br /&gt;
  root@machine:~# systemctl status openvpn@swh.service&lt;br /&gt;
  openvpn@swh.service - OpenVPN connection to swh&lt;br /&gt;
   Loaded: loaded (/lib/systemd/system/openvpn@.service; indirect; vendor preset: enabled)&lt;br /&gt;
   Active: active (running) since Thu 2020-12-17 19:03:29 IST; 22min ago&lt;br /&gt;
     Docs: man:openvpn(8)&lt;br /&gt;
           https://community.openvpn.net/openvpn/wiki/Openvpn24ManPage&lt;br /&gt;
           https://community.openvpn.net/openvpn/wiki/HOWTO&lt;br /&gt;
 Main PID: 12302 (openvpn)&lt;br /&gt;
   Status: &amp;quot;Initialization Sequence Completed&amp;quot;&lt;br /&gt;
    Tasks: 1 (limit: 4915)&lt;br /&gt;
   CGroup: /system.slice/system-openvpn.slice/openvpn@swh.service&lt;br /&gt;
           └─12302 /usr/sbin/openvpn --daemon ovpn-swh --status /run/openvpn/swh.status 10 --cd /etc/openvpn --script-security 2 --config /etc/openvpn/swh.conf --writepid /run/openvpn/swh.pid&lt;br /&gt;
&lt;br /&gt;
Dec 17 19:03:29 machine systemd[1]: Starting OpenVPN connection to swh...&lt;br /&gt;
Dec 17 19:03:29 machine systemd[1]: Started OpenVPN connection to swh.&lt;br /&gt;
&lt;br /&gt;
=== Network Manager GUI ===&lt;br /&gt;
&lt;br /&gt;
You need network-manager-openvpn and network-manager-openvpn-gnome for the configuration gui.&lt;br /&gt;
&lt;br /&gt;
[[File:nm_openvpn_base.png]]&lt;br /&gt;
[[File:nm_openvpn_routes.png]]&lt;br /&gt;
[[File:nm_openvpn_advanced_general.png]]&lt;br /&gt;
[[File:nm_openvpn_advanced_security.png]]&lt;br /&gt;
[[File:nm_openvpn_advanced_tls_auth.png]]&lt;br /&gt;
&lt;br /&gt;
== Obtaining a client certificate ==&lt;br /&gt;
&lt;br /&gt;
=== For users ===&lt;br /&gt;
&lt;br /&gt;
Generate a keypair (key + certificate signing request) using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
openssl req -new -newkey rsa:2048 -nodes -keyout openvpn.key -out openvpn.csr -subj &amp;quot;/CN=&amp;lt;your username&amp;gt;&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Please replace &amp;lt;your username&amp;gt; with something that uniquely identifies the certificate.&lt;br /&gt;
&lt;br /&gt;
Make sure openvpn.key is stored in a safe place (it&#039;s your private key, which will allow anyone to connect to the VPN).&lt;br /&gt;
&lt;br /&gt;
Provide the CSR file to a sysadmin through a reasonably authenticated medium.&lt;br /&gt;
&lt;br /&gt;
=== For admins ===&lt;br /&gt;
&lt;br /&gt;
* On the firewall (192.168.50.1), go to the [https://192.168.50.1/system_certmanager.php System / Trust / Certificates page]&lt;br /&gt;
* click on the add button on the upper right&lt;br /&gt;
[[File:Vpn-main-trust-page.png]]&lt;br /&gt;
* On the Method list, choose &amp;quot;Sign a certificate Signing Request&amp;quot;&lt;br /&gt;
[[File:Vpn-csr-signing.png]]&lt;br /&gt;
&lt;br /&gt;
Fetch the CSR file provided by the user, for instance with &amp;lt;tt&amp;gt;scp USERNAME.csr louvre:&amp;lt;/tt&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* Enter the user name on the descriptive name&lt;br /&gt;
* Select &amp;quot;OpenVPN Software Heritage (louvre)&amp;quot; as Certificate Authority&lt;br /&gt;
* Enter the duration, usually 10 years&lt;br /&gt;
* Paste the csr &lt;br /&gt;
* Validate&lt;br /&gt;
&lt;br /&gt;
* check the details of the csr and validate&lt;br /&gt;
&lt;br /&gt;
== Revoking a client certificate ==&lt;br /&gt;
&lt;br /&gt;
On louvre:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@louvre:~# cd /etc/openvpn/keys&lt;br /&gt;
root@louvre:/etc/openvpn/keys# ./easyrsa revoke USERNAME&lt;br /&gt;
[ say yes ]&lt;br /&gt;
root@louvre:/etc/openvpn/keys# ./easyrsa gen-crl; chmod a+r pki/crl.pem&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
OpenVPN re-reads the CRL at each connection (which is why we need the CRL to be world-readable), so once the cert is revoked, there&#039;s nothing more to do. If you want to make sure the client is disconnected, you need to restart OpenVPN (which will make all clients reconnect).&lt;br /&gt;
&lt;br /&gt;
== /etc/hosts entries ==&lt;br /&gt;
&lt;br /&gt;
Once the Vpn is setup on your machine, you can access Software Heritage hosts via their private IP addresses; see [[Network configuration]].&lt;br /&gt;
&lt;br /&gt;
OpenVPN now pushes the address of our DNS server (192.168.100.29, pergamon).&lt;br /&gt;
&lt;br /&gt;
You might want to add louvre.softwareheritage.org in your /etc/hosts to avoid a bootstrap problem if the &amp;quot;on-vpn&amp;quot; DNS server is in your resolv.conf.&lt;br /&gt;
&lt;br /&gt;
[[Category:Infrastructure]]&lt;br /&gt;
[[Category:System administration]]&lt;/div&gt;</summary>
		<author><name>Vsellier</name></author>
	</entry>
	<entry>
		<id>https://wiki.softwareheritage.org/index.php?title=File:Vpn-main_trust-page.png&amp;diff=1594</id>
		<title>File:Vpn-main trust-page.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=File:Vpn-main_trust-page.png&amp;diff=1594"/>
		<updated>2021-07-09T10:02:28Z</updated>

		<summary type="html">&lt;p&gt;Vsellier: Vsellier moved page File:Vpn-main trust-page.png to File:Vpn-main-trust-page.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[File:Vpn-main-trust-page.png]]&lt;/div&gt;</summary>
		<author><name>Vsellier</name></author>
	</entry>
	<entry>
		<id>https://wiki.softwareheritage.org/index.php?title=File:Vpn-main-trust-page.png&amp;diff=1593</id>
		<title>File:Vpn-main-trust-page.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=File:Vpn-main-trust-page.png&amp;diff=1593"/>
		<updated>2021-07-09T10:02:28Z</updated>

		<summary type="html">&lt;p&gt;Vsellier: Vsellier moved page File:Vpn-main trust-page.png to File:Vpn-main-trust-page.png&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vsellier</name></author>
	</entry>
	<entry>
		<id>https://wiki.softwareheritage.org/index.php?title=File:Vpn-main-trust-page.png&amp;diff=1592</id>
		<title>File:Vpn-main-trust-page.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=File:Vpn-main-trust-page.png&amp;diff=1592"/>
		<updated>2021-07-09T10:01:29Z</updated>

		<summary type="html">&lt;p&gt;Vsellier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vsellier</name></author>
	</entry>
	<entry>
		<id>https://wiki.softwareheritage.org/index.php?title=File:Vpn-csr-signing.png&amp;diff=1591</id>
		<title>File:Vpn-csr-signing.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.softwareheritage.org/index.php?title=File:Vpn-csr-signing.png&amp;diff=1591"/>
		<updated>2021-07-09T10:01:02Z</updated>

		<summary type="html">&lt;p&gt;Vsellier: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Vsellier</name></author>
	</entry>
</feed>