<?xml version="1.0" encoding="UTF-8"?>
<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/"
	>

<channel>
	<title>controlc.de &#187; zertifikate</title>
	<atom:link href="http://controlc.de/tag/zertifikate/feed/" rel="self" type="application/rss+xml" />
	<link>http://controlc.de</link>
	<description>mehr als nur ein Notizblock</description>
	<lastBuildDate>Mon, 16 Apr 2012 12:43:35 +0000</lastBuildDate>
	<language>de</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>debian &#124; Zertifikate für Exchange erstellen und einbinden</title>
		<link>http://controlc.de/2009/07/22/debian-zertifikate-fur-exchange-erstellen-und-einbinden/</link>
		<comments>http://controlc.de/2009/07/22/debian-zertifikate-fur-exchange-erstellen-und-einbinden/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 13:50:07 +0000</pubDate>
		<dc:creator>controlc.de</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[exchange]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[zertifikate]]></category>

		<guid isPermaLink="false">http://controlc.de/?p=768</guid>
		<description><![CDATA[Gestern musste ich feststellen, das mein Exchange keine Mails mehr an mein Mail-Gateway verschickt. Nach einer Weile habe ich dann bemerkt, das das Zertifikat abgelaufen ist. Da sich inzwischen durch den Schwenk auf einen anderen vServer auch die CA geändert hat, wollte ich in dem Zuge gleich alles gerade rücken. Mit meinem schon bekannten Zertifikate-Skript [...]]]></description>
			<content:encoded><![CDATA[	<p>Gestern musste ich feststellen, das mein Exchange keine Mails mehr an mein Mail-Gateway verschickt. Nach einer Weile habe ich dann bemerkt, das das Zertifikat abgelaufen ist. Da sich inzwischen durch den Schwenk auf einen anderen vServer auch die CA geändert hat, wollte ich in dem Zuge gleich alles gerade rücken.</p>
	<p>Mit meinem schon <a href="http://controlc.de/2009/05/11/zertifikaterstellungsskript/">bekannten Zertifikate-Skript</a> habe ich problemlos ein neues Zertifikat für den Exchange ausgestellt</p>
	<p>Jetzt aber muss das Zertifikat in ein für den Exchange lesbares Format gewandelt werden. Dazu exportieren wir den privaten wie auch den öffentlichen Teil des Zertifikats als PK12</p>
	
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">openssl pkcs12 <span style="color: #660033;">-export</span> <span style="color: #660033;">-in</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>cert.pem <span style="color: #660033;">-inkey</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>private<span style="color: #000000; font-weight: bold;">/</span>key.pem <span style="color: #660033;">-out</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #000000; font-weight: bold;">/</span>windows.p12</pre></div></div>

	<p>Und natürlich muss auch das neue Zertifikat der Root-CA mit. Dazu reicht es aber das schon erstellte PEM-File zu kopieren.</p>
	<p><span id="more-768"></span>Nachdem wir beide Dateien auf den Exchange kopiert habe müssen diese als Zertifikate importiert werden. Dazu öffnen wir die <em>Microsoft Management Console (MMC)</em> und laden das Snap-In <em>Zertifikate</em></p>
	<p><a href="http://controlc.de/wp-content/uploads/2009/07/mmc-snapin-zertifikate.png" class="floatbox" rev="group:768 caption:`MMC Snap-In Zertifikate`"><img class="aligncenter size-medium wp-image-769" title="MMC Snap-In Zertifikate" src="http://controlc.de/wp-content/uploads/2009/07/mmc-snapin-zertifikate-300x156.png" alt="MMC Snap-In Zertifikate" width="300" height="156" /></a></p>
	<p>Bei den weiteren Abfragen bitte wie auf den Screenshots zu sehen ist vorgehen.</p>
	<p><a href="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-Computerkonto1.png" class="floatbox" rev="group:768 caption:`MMC Snap-In Zertifikate Computerkonto`"><img class="aligncenter size-medium wp-image-773" title="MMC Snap-In Zertifikate Computerkonto" src="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-Computerkonto1-300x216.png" alt="MMC Snap-In Zertifikate Computerkonto" width="300" height="216" /></a></p>
	<p><a href="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-Computerkonto1.png" class="floatbox" rev="group:768"></a><a href="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-lokaler-Computer.png" class="floatbox" rev="group:768 caption:`MMC Snap-In Zertifikate lokaler Computer`"><img class="aligncenter size-medium wp-image-781" title="MMC Snap-In Zertifikate lokaler Computer" src="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-lokaler-Computer-300x215.png" alt="MMC Snap-In Zertifikate lokaler Computer" width="300" height="215" /></a></p>
	<p>Zuerst werden die beiden Zertifikate als eigene Zertifikate importiert.</p>
	<p><a href="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-Eigene-Zertifikate-2.png" class="floatbox" rev="group:768 caption:`MMC Snap-In Zertifikate - Eigene Zertifikate`"><img class="aligncenter size-full wp-image-788" title="MMC Snap-In Zertifikate - Eigene Zertifikate" src="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-Eigene-Zertifikate-2.png" alt="MMC Snap-In Zertifikate - Eigene Zertifikate" width="186" height="67" /></a></p>
	<p>Dazu auf der rechten Seite mit einem Rechtsklick und dann <em>Alle Aufgaben/Importieren…</em> beide Zertifikate einladen.</p>
	<p><a href="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-Import.png" class="floatbox" rev="group:768 caption:`MMC Snap-In Zertifikate - Import`"><img class="aligncenter size-medium wp-image-775" title="MMC Snap-In Zertifikate - Import" src="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-Import-300x148.png" alt="MMC Snap-In Zertifikate - Import" width="300" height="148" /></a></p>
	<p>Dann muss das Zertifikat der Root-CA noch in die <em>Vertrauenswürdigen Stammzertifizierungsstellen</em> verschoben werden.</p>
	<p><a href="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-RootCAs-2.png" class="floatbox" rev="group:768 caption:`MMC Snap-In Zertifikate - RootCAs`"><img class="aligncenter size-full wp-image-789" title="MMC Snap-In Zertifikate - RootCAs" src="http://controlc.de/wp-content/uploads/2009/07/MMC-Snap-In-Zertifikate-RootCAs-2.png" alt="MMC Snap-In Zertifikate - RootCAs" width="288" height="81" /></a></p>
	<p>Damit hat man den Grundstock geschaffen. Anschließend kann dann das Zertifikat an den entsprechenden Stellen in den Exchange eingebunden werden.</p>
	<p>Zuerst für SMTPs im Exchange System-Manager</p>
	<p><a href="http://controlc.de/wp-content/uploads/2009/07/Exchange-SMTPs-1.png" class="floatbox" rev="group:768 caption:`Exchange - SMTPs 1`"><img class="aligncenter size-medium wp-image-784" title="Exchange - SMTPs 1" src="http://controlc.de/wp-content/uploads/2009/07/Exchange-SMTPs-1-300x210.png" alt="Exchange - SMTPs 1" width="300" height="210" /></a></p>
	<p><a href="http://controlc.de/wp-content/uploads/2009/07/Exchange-SMTPs2.png" class="floatbox" rev="group:768 caption:`Exchange - SMTPs 2`"><img class="aligncenter size-medium wp-image-778" title="Exchange - SMTPs 2" src="http://controlc.de/wp-content/uploads/2009/07/Exchange-SMTPs2-269x300.png" alt="Exchange - SMTPs 2" width="269" height="300" /></a></p>
	<p>Analog dazu trägt man das neue Zertifikat auch in IMAPs ein.
</p>
]]></content:encoded>
			<wfw:commentRss>http://controlc.de/2009/07/22/debian-zertifikate-fur-exchange-erstellen-und-einbinden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>debian &#124; OpenVPN-Server einrichten</title>
		<link>http://controlc.de/2009/06/03/debian-openvpn-server-einrichten/</link>
		<comments>http://controlc.de/2009/06/03/debian-openvpn-server-einrichten/#comments</comments>
		<pubDate>Wed, 03 Jun 2009 22:33:29 +0000</pubDate>
		<dc:creator>controlc.de</dc:creator>
				<category><![CDATA[debian]]></category>
		<category><![CDATA[netzwerk]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[openvpn]]></category>
		<category><![CDATA[zertifikate]]></category>

		<guid isPermaLink="false">http://controlc.de/?p=554</guid>
		<description><![CDATA[VPN-Server sind ne tolle Geschichte, da man damit verschiedenste Dinge erledigen kann: abgesicherte Kommunikation exklusive und vertraute Verbindungen Umgehung von providerabhängigen Gängeleien Neben dem reinen Interesse an der Technik möchte ich folgendes davon erreichen: Über den VPN-Tunnel soll mein Heim-Exchange seine Mails an das Mail-Gateway absetzen können — dabei kann ich die spezielle smtpd-Instanz mit [...]]]></description>
			<content:encoded><![CDATA[	<p>VPN-Server sind ne tolle Geschichte, da man damit verschiedenste Dinge erledigen kann:</p>
	<ul>
	<li>abgesicherte Kommunikation</li>
	<li>exklusive und vertraute Verbindungen</li>
	<li>Umgehung von providerabhängigen Gängeleien</li>
	</ul>
	<p>Neben dem reinen Interesse an der Technik möchte ich folgendes davon erreichen:</p>
	<ul>
	<li>Über den VPN-Tunnel soll mein Heim-Exchange seine Mails an das Mail-Gateway absetzen können — dabei kann ich die spezielle smtpd-Instanz mit weniger Restriktionen laufen lassen (z.B. keine Überprüfung auf Viren und Spam)</li>
	<li>wenn ich das nächste Mail in China bin möchte ich über den VPN-Tunnel ohne Einschränkungen im Internet unterwegs sein können</li>
	</ul>
	<p>Aber nun zur Einrichtung: <span id="more-554"></span></p>
	<h2>Vorbereitung</h2>
	<p>Zuerst müssen wir die Pakete <em>openvpn</em> (klar, was sonst) und <em>udev </em>installieren. <em>udev</em> benötigen wir, damit das Erstellen des virtuellen Interface dynamisch erfolgt.</p>
	
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">aptitude</span> <span style="color: #c20cb9; font-weight: bold;">install</span> udev openvpn</pre></div></div>

	<p>Damit man über den Server eine Verbindung ins Internet aufbauen kann muß man noch das IP-Forwarding einschalten. Dazu editiert man die Datei <code>/etc/sysctl.conf</code> und aktiviert den Eintrag  <code>net.ipv4.ip_forward = 1</code></p>
	<h2>Zertifikate erstellen</h2>
	<p>Wir benötigen für OpenVPN Zertifikate, d.h. eine bestehende CA und müssen dann weitere Clientzertifikate erstellen. Zuerst aber müssen wir einen sogenannten Diffie-Hellman Parameter erzeugen. Dieser wird, laut dem <a href="http://wiki.openvpn.eu/index.php/Erzeugen_einer_PKI_mit_EasyRSA#Diffie-Hellman_Parameter_erzeugen">OpenVPN.eu-Wiki</a>, »vom OpenVPN Server verwendet um bei vielen gleichzeitigen Clientverbindungen den TLS-Handshake zu beschleunigen.«</p>
	
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl<span style="color: #666666; font-style: italic;"># openssl dhparam -out dh1024.pem 1024</span>
Generating DH parameters, <span style="color: #000000;">1024</span> bit long safe prime, generator <span style="color: #000000;">2</span>
This is going to take a long <span style="color: #000000; font-weight: bold;">time</span>
..................+......................+......+...............</pre></div></div>

	<p>Nun nutze ich mein <a href="http://controlc.de/2009/05/11/zertifikaterstellungsskript/">Zertifikatsskript</a> zur Erstellung des Server-Zertifikats</p>
	
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">create_certs vpn.domain.de</pre></div></div>

	<p>Und damit habe ich folgende Dateien erstellt, die ich zukünftig brauche  <code>/etc/ssl/vpn.domain.de-cert.pem /etc/ssl/private/vpn.domain.de-key.pem</code> Natürlich brauche ich noch Zertifikate für die Clients, diese erstell ich mit</p>
	
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">create_certs client1</pre></div></div>

	<p>Wichtig ist dabei, das als <em>common name</em> der Clientname (in dem Beispiel <code>client1</code>) angegeben wird. Anschließend können die Dateien <code>/etc/ssl/client1-cert.pem</code> und <code>/etc/ssl/private/client1-key.pem</code> sowie <code>/etc/ssl/cacert.pem</code> auf den Client kopiert werden, damit dieser sich mit einem gültigen Zertifikat später verbinden kann.</p>
	<h2>Konfigurationsdatei erstellen</h2>
	<p>Anschließend habe ich aus /usr/share/doc/openvpn/examples die Datei server.conf.gz nach /etc/openssl kopiert und dort ausgepackt. Beim Editieren dieser Datei habe ich die Pfade und die Namen der Zertifikatsdateien sowie das Logging angepaßt. Die Datei (meine Änderungen sind rot markiert) sieht anschließend so aus</p>
	<blockquote>
	<pre>#################################################
# Sample OpenVPN 2.0 config file for            #
# multi-client server.                          #
#                                               #
# This file is for the server side              #
# of a many-clients &lt;-&gt; one-server              #
# OpenVPN configuration.                        #
#                                               #
# OpenVPN also supports                         #
# single-machine &lt;-&gt; single-machine             #
# configurations (See the Examples page         #
# on the web site for more info).               #
#                                               #
# This config should work on Windows            #
# or Linux/BSD systems.  Remember on            #
# Windows to quote pathnames and use            #
# double backslashes, e.g.:                     #
# \"C:\\Program Files\\OpenVPN\\config\\foo.key\" #
#                                               #
# Comments are preceded with '#' or ';'         #
#################################################
	
# Which local IP address should OpenVPN
# listen on? (optional)
;local a.b.c.d
	
# Which TCP/UDP port should OpenVPN listen on?
# If you want to run multiple OpenVPN instances
# on the same machine, use a different port
# number for each one.  You will need to
# open up this port on your firewall.
port 1194
	
# TCP or UDP server?
;proto tcp
proto udp</pre>
	<pre># \"dev tun\" will create a routed IP tunnel,
# \"dev tap\" will create an ethernet tunnel.
# Use \"dev tap0\" if you are ethernet bridging
# and have precreated a tap0 virtual interface
# and bridged it with your ethernet interface.
# If you want to control access policies
# over the VPN, you must create firewall
# rules for the the TUN/TAP interface.
# On non-Windows systems, you can give
# an explicit unit number, such as tun0.
# On Windows, use \"dev-node\" for this.
# On most systems, the VPN will not function
# unless you partially or fully disable
# the firewall for the TUN/TAP interface.
;dev tap
dev tun
	
# Windows needs the TAP-Win32 adapter name
# from the Network Connections panel if you
# have more than one.  On XP SP2 or higher,
# you may need to selectively disable the
# Windows firewall for the TAP adapter.
# Non-Windows systems usually don't need this.
;dev-node MyTap
	
# SSL/TLS root certificate (ca), certificate
# (cert), and private key (key).  Each client
# and the server must have their own cert and
# key file.  The server and all clients will
# use the same ca file.
#
# See the \"easy-rsa\" directory for a series
# of scripts for generating RSA certificates
# and private keys.  Remember to use
# a unique Common Name for the server
# and each of the client certificates.
#
# Any X509 key management system can be used.
# OpenVPN can also use a PKCS #12 formatted key file
# (see \"pkcs12\" directive in man page).
<span style=\"color: #ff0000;\">ca /etc/ssl/cacert.pem
cert /etc/ssl/vpn.domain.de-cert.pem
key /etc/ssl/private/vpn.domain.de-key.pem</span>  # This file should be kept secret
	
# Diffie hellman parameters.</pre>
	<pre># Generate your own with:
#   openssl dhparam -out dh1024.pem 1024
# Substitute 2048 for 1024 if you are using
# 2048 bit keys.
<span style=\"color: #ff0000;\">dh /etc/ssl/dh1024.pem</span>
	
# Configure server mode and supply a VPN subnet
# for OpenVPN to draw client addresses from.
# The server will take 10.8.0.1 for itself,
# the rest will be made available to clients.
# Each client will be able to reach the server
# on 10.8.0.1. Comment this line out if you are
# ethernet bridging. See the man page for more info.
server 10.8.0.0 255.255.255.0
	
# Maintain a record of client &lt;-&gt; virtual IP address
# associations in this file.  If OpenVPN goes down or
# is restarted, reconnecting clients can be assigned
# the same virtual IP address from the pool that was
# previously assigned.
ifconfig-pool-persist ipp.txt
	
# Configure server mode for ethernet bridging.
# You must first use your OS's bridging capability
# to bridge the TAP interface with the ethernet
# NIC interface.  Then you must manually set the
# IP/netmask on the bridge interface, here we
# assume <a class=\"linkification-ext\" title=\"Linkification: http://10.8.0.4/255.255.255.0\" href=\"http://10.8.0.4/255.255.255.0\">10.8.0.4/255.255.255.0</a>.  Finally we
# must set aside an IP range in this subnet
# (start=10.8.0.50 end=10.8.0.100) to allocate
# to connecting clients.  Leave this line commented
# out unless you are ethernet bridging.
;server-bridge 10.8.0.4 255.255.255.0 10.8.0.50 10.8.0.100
	
# Configure server mode for ethernet bridging
# using a DHCP-proxy, where clients talk
# to the OpenVPN server-side DHCP server
# to receive their IP address allocation
# and DNS server addresses.  You must first use
# your OS's bridging capability to bridge the TAP
# interface with the ethernet NIC interface.
# Note: this mode only works on clients (such as
# Windows), where the client-side TAP adapter is
# bound to a DHCP client.
;server-bridge</pre>
	<pre># Push routes to the client to allow it
# to reach other private subnets behind
# the server.  Remember that these
# private subnets will also need
# to know to route the OpenVPN client
# address pool (<a class=\"linkification-ext\" title=\"Linkification: http://10.8.0.0/255.255.255.0\" href=\"http://10.8.0.0/255.255.255.0\">10.8.0.0/255.255.255.0</a>)
# back to the OpenVPN server.
;push \"route 192.168.10.0 255.255.255.0\"
;push \"route 192.168.20.0 255.255.255.0\"
	
# To assign specific IP addresses to specific
# clients or if a connecting client has a private
# subnet behind it that should also have VPN access,
# use the subdirectory \"ccd\" for client-specific
# configuration files (see man page for more info).
	
# EXAMPLE: Suppose the client
# having the certificate common name \"Thelonious\"
# also has a small subnet behind his connecting
# machine, such as <a class=\"linkification-ext\" title=\"Linkification: http://192.168.40.128/255.255.255.248\" href=\"http://192.168.40.128/255.255.255.248\">192.168.40.128/255.255.255.248</a>.
# First, uncomment out these lines:
;client-config-dir ccd
;route 192.168.40.128 255.255.255.248
	
# Then create a file ccd/Thelonious with this line:
#   iroute 192.168.40.128 255.255.255.248
# This will allow Thelonious' private subnet to
# access the VPN.  This example will only work
# if you are routing, not bridging, i.e. you are
# using \"dev tun\" and \"server\" directives.
	
# EXAMPLE: Suppose you want to give
# Thelonious a fixed VPN IP address of 10.9.0.1.
# First uncomment out these lines:
;client-config-dir ccd
;route 10.9.0.0 255.255.255.252
	
# Then add this line to ccd/Thelonious:
#   ifconfig-push 10.9.0.1 10.9.0.2
	
# Suppose that you want to enable different
# firewall access policies for different groups
# of clients.  There are two methods:
# (1) Run multiple OpenVPN daemons, one for each
#     group, and firewall the TUN/TAP interface
#     for each group/daemon appropriately.
# (2) (Advanced) Create a script to dynamically
#     modify the firewall in response to access
#     from different clients.  See man
#     page for more info on learn-address script.
;learn-address ./script
	
# If enabled, this directive will configure
# all clients to redirect their default
# network gateway through the VPN, causing
# all IP traffic such as web browsing and
# and DNS lookups to go through the VPN
# (The OpenVPN server machine may need to NAT
# or bridge the TUN/TAP interface to the internet
# in order for this to work properly).
;push \"redirect-gateway def1 bypass-dhcp\"
	
# Certain Windows-specific network settings
# can be pushed to clients, such as DNS
# or WINS server addresses.  CAVEAT:
# <a class=\"linkification-ext\" title=\"Linkification: http://openvpn.net/faq.html#dhcpcaveats\" href=\"http://openvpn.net/faq.html#dhcpcaveats\">http://openvpn.net/faq.html#dhcpcaveats</a>
# The addresses below refer to the public
# DNS servers provided by opendns.com.
;push \"dhcp-option DNS 208.67.222.222\"
;push \"dhcp-option DNS 208.67.220.220\"
	
# Uncomment this directive to allow different
# clients to be able to \"see\" each other.
# By default, clients will only see the server.
# To force clients to only see the server, you
# will also need to appropriately firewall the
# server's TUN/TAP interface.
;client-to-client
	
# Uncomment this directive if multiple clients
# might connect with the same certificate/key
# files or common names.  This is recommended
# only for testing purposes.  For production use,
# each client should have its own certificate/key
# pair.
#
# IF YOU HAVE NOT GENERATED INDIVIDUAL
# CERTIFICATE/KEY PAIRS FOR EACH CLIENT,
# EACH HAVING ITS OWN UNIQUE \"COMMON NAME\",
# UNCOMMENT THIS LINE OUT.
;duplicate-cn
	
# The keepalive directive causes ping-like
# messages to be sent back and forth over
# the link so that each side knows when
# the other side has gone down.
# Ping every 10 seconds, assume that remote
# peer is down if no ping received during
# a 120 second time period.
keepalive 10 120
	
# For extra security beyond that provided
# by SSL/TLS, create an \"HMAC firewall\"
# to help block DoS attacks and UDP port flooding.
#
# Generate with:
#   openvpn --genkey --secret ta.key
#
# The server and each client must have
# a copy of this key.
# The second parameter should be '0'
# on the server and '1' on the clients.
;tls-auth ta.key 0 # This file is secret
	
# Select a cryptographic cipher.
# This config item must be copied to
# the client config file as well.
;cipher BF-CBC        # Blowfish (default)
;cipher AES-128-CBC   # AES
;cipher DES-EDE3-CBC  # Triple-DES
	
# Enable compression on the VPN link.
# If you enable it here, you must also
# enable it in the client config file.
comp-lzo
	
# The maximum number of concurrently connected
# clients we want to allow.
;max-clients 100
	
# It's a good idea to reduce the OpenVPN
# daemon's privileges after initialization.
#
# You can uncomment this out on
# non-Windows systems.
;user nobody
;group nogroup
	
# The persist options will try to avoid
# accessing certain resources on restart
# that may no longer be accessible because
# of the privilege downgrade.
persist-key
persist-tun
	
# Output a short status file showing
# current connections, truncated
# and rewritten every minute.
status openvpn-status.log
	
# By default, log messages will go to the syslog (or
# on Windows, if running as a service, they will go to
# the \"\Program Files\OpenVPN\log\" directory).
# Use log or log-append to override this default.
# \"log\" will truncate the log file on OpenVPN startup,
# while \"log-append\" will append to it.  Use one
# or the other (but not both).
;log         openvpn.log
<span style=\"color: #ff0000;\">log-append  /var/log/openvpn.log</span>
	
# Set the appropriate level of log
# file verbosity.
#
# 0 is silent, except for fatal errors
# 4 is reasonable for general usage
# 5 and 6 can help to debug connection problems
# 9 is extremely verbose
verb 3
	
# Silence repeating messages.  At most 20
# sequential messages of the same message
# category will be output to the log.
;mute 20</pre>
	</blockquote>
	<p>Natürlich ist die Konfiguration noch lange nicht optimiert und ermöglicht noch nicht alles, was ich mir als Ziel gesetzt habe.  Mit einem</p>
	
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>openvpn start</pre></div></div>

	<p>starten wir den Server. Um zu schauen, ob alles funktioniert schauen wir uns zuerst die  Datei <code>/var/log/openvpn.log</code> an</p>
	<blockquote>
	<pre>Wed Jun  3 23:26:18 2009 OpenVPN 2.1_rc11 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Sep 18 2008
Wed Jun  3 23:26:18 2009 Diffie-Hellman initialized with 1024 bit key
Wed Jun  3 23:26:18 2009 WARNING: file '/etc/ssl/private/vpn.domain.de-key.pem' is group or others accessible
Wed Jun  3 23:26:18 2009 /usr/bin/openssl-vulnkey -q -b 1024 -m &lt;modulus omitted&gt;
Wed Jun  3 23:26:18 2009 TLS-Auth MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ]
Wed Jun  3 23:26:18 2009 ROUTE default_gateway=180.190.200.1
Wed Jun  3 23:26:18 2009 TUN/TAP device tun0 opened
Wed Jun  3 23:26:18 2009 TUN/TAP TX queue length set to 100
Wed Jun  3 23:26:18 2009 /sbin/ifconfig tun0 10.8.0.1 pointopoint 10.8.0.2 mtu 1500
Wed Jun  3 23:26:18 2009 /sbin/route add -net 10.8.0.0 netmask 255.255.255.0 gw 10.8.0.2
Wed Jun  3 23:26:18 2009 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ]
Wed Jun  3 23:26:18 2009 Socket Buffers: R=[129024-&gt;131072] S=[129024-&gt;131072]
Wed Jun  3 23:26:18 2009 UDPv4 link local (bound): [undef]:1194
Wed Jun  3 23:26:18 2009 UDPv4 link remote: [undef]
Wed Jun  3 23:26:18 2009 MULTI: multi_init called, r=256 v=256
Wed Jun  3 23:26:18 2009 IFCONFIG POOL: base=10.8.0.4 size=62
Wed Jun  3 23:26:18 2009 IFCONFIG POOL LIST
Wed Jun  3 23:26:18 2009 Initialization Sequence Completed</pre>
	</blockquote>
	<p>Damit steht unser Server schon mal und in einem <a href="http://controlc.de/2009/06/09/mac-openvpn-und-tunnelblick/">weiteren Beitrag</a> zeige ich, wie man sich mit einem Client verbindet.
</p>
]]></content:encoded>
			<wfw:commentRss>http://controlc.de/2009/06/03/debian-openvpn-server-einrichten/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>debian &#124; Zertifikaterstellungsskript</title>
		<link>http://controlc.de/2009/05/11/zertifikaterstellungsskript/</link>
		<comments>http://controlc.de/2009/05/11/zertifikaterstellungsskript/#comments</comments>
		<pubDate>Mon, 11 May 2009 10:20:07 +0000</pubDate>
		<dc:creator>controlc.de</dc:creator>
				<category><![CDATA[allgemeine IT]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[skript]]></category>
		<category><![CDATA[zertifikate]]></category>

		<guid isPermaLink="false">http://controlc.de/?p=126</guid>
		<description><![CDATA[Wenn man mit https seine Webseiten bzw. deren Kommunikation oder aber das Senden von Emails über SSL absichert, dann kommt man nicht drumherum ab und an ein neues Zertifikat auszustellen. Da ich das nicht jeden Tag mache und mich dann immer wieder totsuche, habe ich mir ein kleines Skript geschrieben: #! /bin/sh cd /etc/ssl openssl [...]]]></description>
			<content:encoded><![CDATA[	<p>Wenn man mit https seine Webseiten bzw. deren Kommunikation oder aber das Senden von Emails über SSL absichert, dann kommt man nicht drumherum ab und an ein neues Zertifikat auszustellen. Da ich das nicht jeden Tag mache und mich dann immer wieder totsuche, habe ich mir ein kleines Skript geschrieben:</p>
	
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#! /bin/sh</span>
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>ssl
openssl req <span style="color: #660033;">-new</span> <span style="color: #660033;">-nodes</span> <span style="color: #660033;">-out</span> <span style="color: #007800;">$1</span>-req.pem <span style="color: #660033;">-keyout</span> private<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$1</span>-key.pem <span style="color: #660033;">-config</span> .<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf
openssl ca <span style="color: #660033;">-out</span> <span style="color: #007800;">$1</span>.pem <span style="color: #660033;">-config</span> .<span style="color: #000000; font-weight: bold;">/</span>openssl.cnf <span style="color: #660033;">-infiles</span> <span style="color: #007800;">$1</span>-req.pem
openssl x509 <span style="color: #660033;">-in</span> <span style="color: #007800;">$1</span>.pem <span style="color: #660033;">-out</span> <span style="color: #007800;">$1</span>-cert.pem</pre></div></div>

	<p>Update: Damit ich das Skript systemweit verwenden kann lege ich es nach <code>/usr/local/bin als create_certs</code> und mache es mit dem Befehl</p>
	
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">chmod</span> g+x <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>local<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>create_certs</pre></div></div>

	<p>ausführbar.</p>
	<p>Update 2: Warum hat mir eigentlich keiner gesagt, das die temporäre Datei $1.pem, die in der dritten openssl-Zeile benötigt wird um aus dem Request ein fertiges Zertifikat zu machen, natürlich am Ende des Skripts gelöscht werden kann? Ein</p>
	
<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$1</span>.pem</pre></div></div>

	<p>in der letzten Zeile sollte reichen.
</p>
]]></content:encoded>
			<wfw:commentRss>http://controlc.de/2009/05/11/zertifikaterstellungsskript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>debian &#124; Zertifikate erstellen</title>
		<link>http://controlc.de/2009/05/11/debian-zertifikate-erstellen/</link>
		<comments>http://controlc.de/2009/05/11/debian-zertifikate-erstellen/#comments</comments>
		<pubDate>Mon, 11 May 2009 10:15:10 +0000</pubDate>
		<dc:creator>controlc.de</dc:creator>
				<category><![CDATA[allgemeine IT]]></category>
		<category><![CDATA[debian]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[openssl]]></category>
		<category><![CDATA[zertifikate]]></category>

		<guid isPermaLink="false">http://controlc.de/2009/03/18/debian-zertifikate-erstellen/</guid>
		<description><![CDATA[Zertifikate sind eine gute Sache — als Server-Admin braucht man sie immer wieder mal. Eine gute Anleitung habe ich bei hack2lern gefunden, welcher m.E. die Webseite Creating and Using a self signed SSL Certificates in debian übersetzt hat. Ich nutze Zertifikate für folgendes: Absicherung der Kommunikation mit meinem privaten Email-Server (Weboberfläche, IMAPs) Authentifizierung und Absicherung [...]]]></description>
			<content:encoded><![CDATA[	<p>Zertifikate sind eine gute Sache — als Server-Admin braucht man sie immer wieder mal. Eine gute Anleitung habe ich bei <a href="http://www.hack2learn.org/howto-self-signed-ssl-certificate" target="_blank">hack2lern</a> gefunden, welcher m.E. die Webseite <a href="http://www.debian-administration.org/articles/284" target="_blank">Creating and Using a self signed  SSL Certificates in debian</a> übersetzt hat.</p>
	<p>Ich nutze Zertifikate für folgendes:</p>
	<ul>
	<li>Absicherung der Kommunikation mit meinem privaten Email-Server (Weboberfläche, IMAPs)</li>
	<li>Authentifizierung und Absicherung des Sendens meines privaten Email-Servers über meinen virtuellen Servers, welcher als Mail-Relay fungiert</li>
	</ul>
	<p>Update: Damit es für mich einfacher ist, habe ich mir ein <a href="http://controlc.de/2009/05/11/zertifikaterstellungsskript/">eigenes Script geschrieben</a>.
</p>
]]></content:encoded>
			<wfw:commentRss>http://controlc.de/2009/05/11/debian-zertifikate-erstellen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

