Wenn Ihr Bedarf habt von Unterwegs auf Euer Zuhause zuzugreifen, dann bieten sich VPN Lösungen an (alles andere ist zu gefährlich wenn Ihr Dienste direkt vom Internet zugreifbar macht)
sudo su curl -L https://raw.githubusercontent.com/pivpn/pivpn/master/auto_install/install.sh | bash
Konfiguration:
Oben Ja ausgewählt damit immer die neuesten Security Patches installiert werden. Wir haben gegenüber dem Internet einen offenen Port. Also dringend zu empfehlen!!!
Danach lauft entsprechend die Installation ein wenig.
(bei Bedarf ein anderes UDP Port verwenden, aber nicht alle Clients können entsprechend andere Ports verwenden wenn man sich per VPN zB: vom Handy dann zuhause einwählen will)
Ffür alle jene die jetzt schon Angst haben vor Quantencomputer können ja sicherheitshalber auf 4096 gehen (das dauert aber dann halt länger)
WICHTIG: Oben einen DNS Namen eintragen den Ihr in Eurem Router konfiguriert habt und für Euch angelegt habt, damit Ihr vom Internet aus immer erreichbar seid. Wenn Ihr immer die gleiche öffentliche IP Adresse habt könnt Ihr einen DNS Namen mit dieser IP Verwenden.
Oben nein ausgewählt im Screenshot
Nach dem reboot dann User noch anlegen. VPN ist ja doppelt abgesichert. (ACHTUNG: Sicheres Passwort vergeben!!!):
pivpn add
Enter a Name for the Client: Handy
How many days should the certificate last? 3650
Enter the password for the client: xxx
Note: using Easy-RSA configuration from:./vars
Using SSL: openssl OpenSSL 1.1.1c 28 May 2019
Generating a RSA privatekey...........................................................................+++++.....+++++
writing newprivatekey to '/etc/openvpn/easy-rsa/pki/private/Handy.key.12ABC3d45D'
Enter PEM pass phrase:xxx
Verifying - Enter PEM pass phrase:xxx
-----
Using configuration from /etc/openvpn/easy-rsa/pki/safessl-easyrsa.cnf
Check that the request matches the signature
Signature ok
The Subject's Distinguished Name is as follows
commonName :ASN.1 12:'Handy'
Certificate is to be certified until Jul 10 10:56:51 2029 GMT (3650 days)
Write out database with 1 new entries
Data Base Updated
Client's cert found: Handy.crt
Client's Private Key found: Handy.key
CA public Key found: ca.crt
tls-auth Private Key found: ta.key
========================================================
Done! Handy.ovpn successfully created!
Handy.ovpn was copied to:
/home/pi/ovpns
for easy transfer. Please use this profile only on one
device and create additional profiles for other devices.
=======================================================
pivpn add Enter a Name for the Client: Handy How many days should the certificate last? 3650 Enter the password for the client: xxx Note: using Easy-RSA configuration from: ./vars
Using SSL: openssl OpenSSL 1.1.1c 28 May 2019 Generating a RSA private key ...........................................................................+++++ .....+++++ writing new private key to '/etc/openvpn/easy-rsa/pki/private/Handy.key.12ABC3d45D' Enter PEM pass phrase:xxx
Verifying - Enter PEM pass phrase:xxx
----- Using configuration from /etc/openvpn/easy-rsa/pki/safessl-easyrsa.cnf Check that the request matches the signature Signature ok The Subject's Distinguished Name is as follows commonName :ASN.1 12:'Handy' Certificate is to be certified until Jul 10 10:56:51 2029 GMT (3650 days)
Write out database with 1 new entries Data Base Updated Client's cert found: Handy.crt Client's Private Key found: Handy.key CA public Key found: ca.crt tls-auth Private Key found: ta.key
======================================================== Done! Handy.ovpn successfully created! Handy.ovpn was copied to: /home/pi/ovpns for easy transfer. Please use this profile only on one device and create additional profiles for other devices. =======================================================
Am Router entsprechend PortForwarding einrichten für das gewählte UDP Port (in meinem Beispiel die Fritzbox im Menüpunkt Internet -> Freigaben -> Gerät für Freigaben hinzufügen):
Jetzt die /home/pi/ovpns/Handy.ovpn Datei auf das Smartphone kopieren, dort OpenVPN aus dem Playstore installieren und entsprechend diese Datei auswählen! User Handy und das Passwort eingeben (kann in der App dort auch gespeichert werden) und Verbinden klicken. WICHTIG: Manchmal muss man in der OpenVPN Verbindung am Handy 2x auf verbinden klicken damit die Verbindung ins Heimnetzwerk funktioniert. Wichtig. Die Datei solltet Ihr auf dem Handy wieder löschen da Sie nur einmalig zum importieren benötigt wird bzgl. Zertifikat!!!