Skip to main content
Hyper 8 Spacefun Videos

Linux Firewall einrichten – Schritt für Schritt zum sicheren System

720p 3.2 MB 720p 3.2 MB

Einsteiger - Preview

Distro WAS? Was ist eine Linux Distribution 23 Feb 2024, 52 sec
Linux herunterladen und Brennen 23 Feb 2024, 52 sec
Meine Lieblings Firefox AddOns 23 Feb 2024, 52 sec
Linux Installieren für Anfänger: In nur 15 Minuten ist Linux drauf 23 Feb 2024, 52 sec
pimp My IceWM - Linux Desktop Design mit Themes und Icons anpassen 23 Feb 2024, 52 sec
Programme installieren unter Linux auf der CLI und mit der Paketverwaltung 23 Feb 2024, 52 sec
Linux Terminal für Einsteiger 23 Feb 2024, 52 sec
Linux updaten - So aktualisierst du sicher deine Linux Distribution 23 Feb 2024, 52 sec
Benutzer und Gruppen verwalten unter Linux 23 Feb 2024, 52 sec
LibreOffice über die Kommandozeile installieren 23 Feb 2024, 52 sec
Linux Password einfach ändern auf der CLI 23 Feb 2024, 52 sec
Logdateien unter Linux anzeigen und Fehler analysieren 23 Feb 2024, 52 sec
Linux Bootsplash anpassen mit Plymouth 23 Feb 2024, 52 sec
Festplattenauslastung unter Linux ermitteln 23 Feb 2024, 52 sec
Desktop Icons mit iDesk für deinen Linux Windowmanager 23 Feb 2024, 52 sec
Replay
Current video (16 of 38) in Einsteiger - Preview Linux Firewall einrichten – Schritt für Schritt zum sicheren System 23 Feb 2024, 52 sec
Alle Programme sofort griffbereit: Application Finder einrichten (oder "Wie komme ich aus vi raus?") 23 Feb 2024, 52 sec
Gefahr gebannt! ClamAV Virenabwehr für dein Linux System 23 Feb 2024, 52 sec
Wie man den Memtest86+ RAM-Test unter Linux erfolgreich nutzt 23 Feb 2024, 52 sec
Unterschiedliche Desktop Umgebungen testen 23 Feb 2024, 52 sec
Linux Backup Tutorial - Laufwerk vorbereiten 23 Feb 2024, 52 sec
Linux Backup Tutorial: Back In Time 23 Feb 2024, 52 sec
Dynablaster Revenge - Bomberman Spiel selbst compilieren 23 Feb 2024, 52 sec
Linux Desktopumgebung LXQt vs. LXDE 23 Feb 2024, 52 sec
Desktop Effekte unter LXQt aktivieren 23 Feb 2024, 52 sec
Die besten Podcast-Clients für Linux 23 Feb 2024, 52 sec
Sicherer SSH-Zugriff unter Linux 23 Feb 2024, 52 sec
Firefox direkt von Mozilla.org installieren 23 Feb 2024, 52 sec
Software sauber entfernen unter Linux mit Apt Rollback 23 Feb 2024, 52 sec
Linux Remote Desktop mit X2Go 23 Feb 2024, 52 sec
Ubuntu LTS installieren oder aktualisieren 23 Feb 2024, 52 sec
Windows in Docker 23 Feb 2024, 52 sec
Portmaster - die perfekte Desktop-Firewall 23 Feb 2024, 52 sec
Linux Multiboot – USB-Stick & Netzwerk mit Ventoy und iVentoy 23 Feb 2024, 52 sec
Thunderbird - das sichere E-Mail Programm 23 Feb 2024, 52 sec
Datum und Uhrzeit einstellen unter Linux 23 Feb 2024, 52 sec
Schnellsten Linux Mirror ermitteln 23 Feb 2024, 52 sec
Festplatte partitionieren unter Linux 23 Feb 2024, 52 sec
00:00 / 00:52
Distro WAS? Was ist eine Linux Distribution 23 Feb 2024, 52 sec
Linux herunterladen und Brennen 23 Feb 2024, 52 sec
Meine Lieblings Firefox AddOns 23 Feb 2024, 52 sec
Linux Installieren für Anfänger: In nur 15 Minuten ist Linux drauf 23 Feb 2024, 52 sec
pimp My IceWM - Linux Desktop Design mit Themes und Icons anpassen 23 Feb 2024, 52 sec
Programme installieren unter Linux auf der CLI und mit der Paketverwaltung 23 Feb 2024, 52 sec
Linux Terminal für Einsteiger 23 Feb 2024, 52 sec
Linux updaten - So aktualisierst du sicher deine Linux Distribution 23 Feb 2024, 52 sec
Benutzer und Gruppen verwalten unter Linux 23 Feb 2024, 52 sec
LibreOffice über die Kommandozeile installieren 23 Feb 2024, 52 sec
Linux Password einfach ändern auf der CLI 23 Feb 2024, 52 sec
Logdateien unter Linux anzeigen und Fehler analysieren 23 Feb 2024, 52 sec
Linux Bootsplash anpassen mit Plymouth 23 Feb 2024, 52 sec
Festplattenauslastung unter Linux ermitteln 23 Feb 2024, 52 sec
Desktop Icons mit iDesk für deinen Linux Windowmanager 23 Feb 2024, 52 sec
Current video (16 of 38) in Einsteiger - Preview Linux Firewall einrichten – Schritt für Schritt zum sicheren System 23 Feb 2024, 52 sec
Alle Programme sofort griffbereit: Application Finder einrichten (oder "Wie komme ich aus vi raus?") 23 Feb 2024, 52 sec
Gefahr gebannt! ClamAV Virenabwehr für dein Linux System 23 Feb 2024, 52 sec
Wie man den Memtest86+ RAM-Test unter Linux erfolgreich nutzt 23 Feb 2024, 52 sec
Unterschiedliche Desktop Umgebungen testen 23 Feb 2024, 52 sec
Linux Backup Tutorial - Laufwerk vorbereiten 23 Feb 2024, 52 sec
Linux Backup Tutorial: Back In Time 23 Feb 2024, 52 sec
Dynablaster Revenge - Bomberman Spiel selbst compilieren 23 Feb 2024, 52 sec
Linux Desktopumgebung LXQt vs. LXDE 23 Feb 2024, 52 sec
Desktop Effekte unter LXQt aktivieren 23 Feb 2024, 52 sec
Die besten Podcast-Clients für Linux 23 Feb 2024, 52 sec
Sicherer SSH-Zugriff unter Linux 23 Feb 2024, 52 sec
Firefox direkt von Mozilla.org installieren 23 Feb 2024, 52 sec
Software sauber entfernen unter Linux mit Apt Rollback 23 Feb 2024, 52 sec
Linux Remote Desktop mit X2Go 23 Feb 2024, 52 sec
Ubuntu LTS installieren oder aktualisieren 23 Feb 2024, 52 sec
Windows in Docker 23 Feb 2024, 52 sec
Portmaster - die perfekte Desktop-Firewall 23 Feb 2024, 52 sec
Linux Multiboot – USB-Stick & Netzwerk mit Ventoy und iVentoy 23 Feb 2024, 52 sec
Thunderbird - das sichere E-Mail Programm 23 Feb 2024, 52 sec
Datum und Uhrzeit einstellen unter Linux 23 Feb 2024, 52 sec
Schnellsten Linux Mirror ermitteln 23 Feb 2024, 52 sec
Festplatte partitionieren unter Linux 23 Feb 2024, 52 sec
Hallo liebe Wurmloch Springer. In diesem Video möchte ich euch zeigen, wie ihr euer Linux-System   00:00
zusätzlich mit einer Firewall schützen könnt. Ich habe mich dabei für die Lösung 'ufw' entschieden. 00:07
ufw steht für uncomplicated Firewall und ist wirklich sehr einfach zu benutzen. Zur Installation   00:16
habe ich hier bereits ein Terminal geöffnet. Ich gebe nun dort den Befehl 'sudo apt install ufw' ein. 00:24
Nun wird hier im Hintergrund  ufw bereits installiert, ist aber   00:31
noch nicht aktiv. Das kann ich prüfen  mit dem Befehl 'sudo ufw status' 00:42
'status inactive', also nicht aktiv. Jetzt schaue ich mir erstmal an was 'sudo ufw help' für Optionen anbietet. 00:49
Hier gibt es jetzt eine ganze Liste von Optionen. Hier sehe ich als allererstes mal die Option   01:02
'enable', also aktivieren. Diese führe ich als Erstes mal aus, um die Firewall überhaupt zu aktivieren.   01:07
Ich gebe also ein: 'sudo ufw enable': 'Firewall ist active and enabled on system startup' das heißt, die Firewall   01:14
ist jetzt schon aktiv und wird beim Systemstart automatisch mit gestartet. Jetzt kann ich mir das   01:23
ganze noch mit 'sudo ufw status' anschauen und da sehe ich jetzt auch die Firewall ist aktiv. 01:29
In der Standardkonfiguration blockt die Firewall das allermeiste. Ich müsste also für meine Applikation 01:36
einzelne Ports freischalten. Jede Applikation, die im Internet erreichbar sein soll, öffnet dazu einen   01:43
Port auf deinen System. Die kann ich mir mit dem Befehl 'netstat' ausgeben lassen. Ich gebe es mal ein 'sudo  01:52
netstat -antp'. Das zeigt mir die aktuell  geöffneten TCP-Ports an und hier sehe ich z.B.: 02:00
hier lauscht auf dem Port 80 und auf dem Port 443 ein Webserver, den ich bei mir auf meinem   02:11
System zuvor installiert habe. Hier werden noch andere Ports angegeben. Hier seht ihr aber davor   02:18
'127.0.0.1' das ist mein sogenannter 'localhost'. Das ist eine IP-Adresse, die nur lokal erreichbar   02:24
ist. Dort lauscht z.B. der Port 631 vom Cups-Daemon. Der Cups-Daemon ist für das Drucken unter Linux 02:33
zuständig und es ist sinnvoll, dass dieser  Lokal erreichbar ist. Aus dem Internet kann   02:42
dieser nicht erreicht werden. Diese Ports sind aber offen und überall aus dem Netzwerk in dem 02:47
du dich gerade befindest sind die erreichbar also Port 80 und Port 443. Da wir jetzt aber die   02:54
ufw schon aktiviert haben, kann aktuell nicht mehr darauf zugegriffen werden. Jetzt müsste   03:00
ich diese wieder aktivieren. Dazu kann man bei ufw sogenannte App-Listen verwenden. Ich kann   03:06
mir die mal anzeigen: 'sudo ufw app list' gibt mir eine Liste aller Applikationen aus, die   03:13
ufw bereits kennt. Da ist z.B. SSH mit drin, was für den Remote-Zugriff unbedingt aktiv sein sollte. 03:22
Dann finde ich hier jetzt z.B. Definitionen über meinen Webserver 'WWW' ist mein Webserver und da   03:30
gibt's verschiedene Definitionen 'WWW', 'WWW Cache' 'Full' und 'Secure'. Ich möchte mir jetzt dazu mal einige   03:37
Details anzeigen lassen und gebe den Befehl 'sudo ufw app info' gefolgt vom Namen der Applikation 03:44
in der Applikationsliste ein. Hier sehen wir aber, diese enthält ein Leererzeichen. Ich muss das Ganze   03:53
also in Anführungszeichen setzen. Ich sage Enter und ich sehe hier: Ah ja, 'Secure' ist nur https und da ist 03:58
nur mein Port 443 drin. Jetzt schauen wir uns das Gleiche mal für die 'Full' Definition an, weil ich möchte ja   04:07
jetzt Port 80 und Port 443 gerne freischalten. In der 'Full' Definition wäre z.B. Port 80 und Port 443   04:13
mit drin. Ich könnte also diese Definition nutzen, um meinen Webserver erreichbar zu machen. Das mache   04:23
ich jetzt mal: 'sudo ufw allow' und dann wieder die Anführungszeichen 'WWW Full'. Ich kann mir das von   04:29
hier oben mit der Maus kopieren, mittlere  Maustaste zum Einfügen und er hat schon die Regel   04:39
hinzugefügt. Ich prüfe das ganze jetzt noch mal durch die Eingabe von 'sudo ufw status'. 'WWW' und   04:45
'WWW full' ist für das Protokoll IPv4 oder das Protokoll IPv6 nun aktiv. Denn ufw kann beides 04:55
bedienen. Es erstellt Regeln für das IPv4- und das IPv6-Protokoll. Du bist auf jeden Fall auf der   05:04
sicheren Seite! Jetzt könnte ich mir das Ganze auch  noch mit dem Parameter 'verbose' angeben für eine 05:11
detaillierte Ausgabe und hier sehe ich jetzt auch  genau die Ports die hier geöffnet worden sind. 05:18
Das wäre jetzt in diesem Fall Port 80 und 443. Wenn du  jetzt z.B. noch mal die Liste: 'sudo ufw help' damit   05:24
kannst du jederzeit wieder die Hilfe aufrufen und  du könntest jetzt z.B noch mal die 'sudo ufw app list' 05:35
anzeigen lassen um dir z.B. alle Regeln  für den Torrent Client Transmission ausgeben   05:42
zu lassen oder diesen zu aktivieren. Wenn jetzt  hier aber irgendwo ein Port nicht mit drin sein   05:50
sollte, also du hast jetzt einen Dienst laufen der  auf einem Port lauscht, der nicht hier über diese   05:56
App-Definitionen erreichbar ist, dann kannst du auch  den Port manuell erlauben. Ich könnte das jetzt mal   06:02
machen 'sudo ufw allow' und jetzt den Port ich sage  jetzt mal Port 1234 gefolgt von einem '/' und   06:08
dem Protokoll in dem Fall 'tcp'. Und jetzt hat er mir  schon eine Regel hinzugefügt. Das heißt nicht, dass   06:17
jetzt aktuell irgendetwas auf diesem Port  lauschen muss. Das heißt nur, dass falls etwas   06:25
auf dem Port lauscht, auch der Zugriff über die  Firewall möglich ist. Ich schaue mir das jetzt noch   06:31
mal an und sehe hier: ah, er hat meine Regel hinzugefügt. Möchte ich die jetzt wieder löschen, kann ich jetzt   06:36
z.B. 'sudo ufw' und dann 'delete', immer vor dem Befehl, den du zuvor ausgeführt hast ein 'delete', 06:44
'delete allow port tcp' und schon ist die Regel wieder  weg. Für ufw gibt es sogar eine grafische   06:52
Applikation, ein grafisches Frontend, das heißt 'gufw'. Das können wir uns noch mal ganz kurz anschauen 07:01
'sudo apt install gufw'. Ich empfehle euch aber die  Einrichtung über die Kommandozeile, denn dort könnt   07:06
ihr viel detaillierter Regeln einrichten. Schauen wir mal wo sich das Ganze im Menü 07:15
versteckt. Wahrscheinlich 07:22
Einstellungen. Ich finde es jetzt hier auf Anhieb im Menü  nicht. Ich könnte es aber auch einfach mal über das   07:29
Terminal öffnen 'gufw'. Jetzt wird natürlich mein  Passwort erfragt, weil ich führe ja die Änderung   07:46
am System durch. Das sind alles Regeln, die am  System durchgeführt werden und hier habe ich   07:53
jetzt auch eine kleine Applikation, die mir das  ganze jetzt auch noch mal grafisch verdeutlicht. 07:58
Hier sehe ich z.B. auch meine 'WWW' Rule. Bericht, hier kann ich jetzt noch mal eine ausführliches   08:04
Protokoll anzeigen lassen und könnte jetzt hier  z.B. auch neue Regeln erstellen. Ich sag jetzt mal z.B. 08:12
'Neue Regel' und da könnte ich auch die Anwendung  hier hinzufügen. Ihr seht aber, eigentlich ist   08:20
die Konfiguration aus der Kommandozeile viel  einfacher. Ihr könnt einfach mit dem Befehlen,   08:25
die ich euch jetzt erklärt habe, eure Firewall  so konfigurieren wie ihr sie braucht. Das war's   08:31
eigentlich schon. Ihr könnt es mal ausprobieren. Ich empfehle euch unbedingt eine Firewall auf   08:38
eurem Linux System zu aktivieren. Damit seid ihr  noch sicherer gegen Angriffe aus dem Internet   08:43
und könnt euch so zusätzlich schützen. Schaut  unbedingt meine Playlist an. Ich empfehle euch   08:49
folgt dieser von Anfang an, denn die einzelnen  Videos bauen aufeinander auf. Und wenn ihr   08:56
einmal eine Frage habt und nicht weiterkommt dann  besucht unsere Telegram-Community. Dort helfen wir   09:01
dir garantiert weiter und wir sind immer für  ein offenes Ohr für dich da. Bis bald. Tschüss 09:07
Hello wormhole jumpers. In this video, I want to show you how you can additionally protect your Linux system 00:00
with a firewall. I chose the 'ufw' solution. 00:07
ufw stands for uncomplicated firewall and is really very easy to use. For installation, 00:16
I've already opened a terminal. I'll now enter the command 'sudo apt install ufw'. 00:24
ufw is now being installed in the background, but is 00:31
not yet active. I can check this with the command 'sudo ufw status' 00:42
'status inactive'. Now I'll first look at the options 'sudo ufw help' offers. 00:49
There's a whole list of options here. The very first option I see is 01:02
'enable'. I'll execute this first to actually activate the firewall. 01:07
So I type: 'sudo ufw enable': 'Firewall is active and enabled on system startup' which means the firewall 01:14
is already active and will start automatically when the system starts. Now I can 01:23
take a look at the whole thing with 'sudo ufw status' and there I can see that the firewall is active. 01:29
In the default configuration the firewall blocks most things. So I would have 01:36
to open individual ports for my application. Every application that needs to be accessible on the internet opens a 01:43
port on your system. I can display this with the command 'netstat'. I type 'sudo 01:52
netstat -antp'. This shows me the currently open TCP ports and here I can see, for example: 02:00
a web server that I previously installed on my system is listening on port 80 and port 443. 02:11
Other ports are also specified here. But here you can see '127.0.0.1' in front of it, 02:18
which is my so-called 'localhost'. This is an IP address that is only accessible locally 02:24
. Port 631 of the Cups daemon, for example, listens there. The Cups daemon is 02:33
responsible for printing under Linux, and it makes sense for it to be accessible locally. 02:42
It cannot be reached from the internet. However, these ports are open and can be reached from anywhere in the network 02:47
you are currently in, i.e. port 80 and port 443. However, since we 02:54
have already activated ufw, they can no longer be accessed. Now 03:00
I need to reactivate it. For this purpose, you can use so-called app lists in ufw. I can 03:06
display them: 'sudo ufw app list' gives me a list of all the applications that 03:13
ufw already knows. This includes SSH, for example, which should definitely be enabled for remote access. 03:22
Then I can find definitions about my web server here, for example. 'WWW' is my web server and there 03:30
are different definitions: 'WWW', 'WWW Cache', 'Full' and 'Secure'. I would now like 03:37
to display some details and enter the command 'sudo ufw app info' followed by the name of the application 03:44
in the application list. But here we can see that this contains a space. So I have to put the whole thing 03:53
in quotation marks. I say Enter and I see here: Ah yes, 'Secure' is only https and it 03:58
only contains my port 443. Now let's look at the same thing for the 'Full' definition, because I would 04:07
now like to open ports 80 and 443. The 'Full' definition would 04:13
include, for example, port 80 and port 443. So I could use this definition to make my web server accessible. I 'll do this 04:23
now: 'sudo ufw allow' and then again the quotation marks 'WWW Full'. I can 04:29
copy this from above with the mouse, middle mouse button to paste, and it has already 04:39
added the rule. I'll check the whole thing again by entering 'sudo ufw status'. 'WWW' and 04:45
'WWW full' are now active for the IPv4 protocol or the IPv6 protocol. Because ufw can 04:55
handle both. It creates rules for the IPv4 and the IPv6 protocol. You're definitely on the 05:04
safe side! Now I could also specify the whole thing with the parameter 'verbose' for a 05:11
detailed output, and here I can see exactly the ports that have been opened here. 05:18
In this case, that would be ports 80 and 443. If you now, for example, run the list again: 'sudo ufw help' with 05:24
you can call up the help at any time and you could now 05:35
display the 'sudo ufw app list' again, for example, 05:42
to see all the rules for the torrent client transmission or to activate it. If a port is not included somewhere - 05:50
i.e. you have a service running that is listening on a port that is not 05:56
accessible via these app definitions - then you can also allow the port manually. I could 06:02
do that now: 'sudo ufw allow' and now the port - let's say port 1234 followed by a '/' and 06:08
the protocol, in this case 'tcp'. And now it has added a rule for me. That doesn't mean that 06:17
anything has to be listening on this port right now. It just means that if something 06:25
is listening on the port, access via the firewall is also possible. I'll take another look 06:31
and see: ah, it has added my rule. If I want to delete it again, I can now, 06:36
for example, type 'sudo ufw' and then 'delete', always before the command you executed previously, 06:44
'delete allow port tcp' and the rule is gone again. There's even a graphical 06:52
application for ufw, a graphical frontend called 'gufw'. We can take a quick look at that again: 07:01
'sudo apt install gufw'. I recommend setting it up via the command line, though, because 07:06
you can set up rules in much more detail there. Let's see where the whole thing is 07:15
hidden in the menu. Probably 07:22
Settings. I can't find it in the menu right now. But I could also just 07:29
open it via the terminal: 'gufw'. Now, of course, my password will be requested, because I'm making the change 07:46
to the system. These are all rules that are implemented on the system, and here I have 07:53
a small application that illustrates the whole thing graphically. 07:58
Here, for example, I can also see my 'WWW' rule. Report. Here I can display a detailed log again 08:04
and could also create new rules, for example. I'll say 08:12
'New Rule,' for example, and I could also add the application here. As you can see, 08:20
configuration from the command line is actually much easier. You can simply 08:25
configure your firewall the way you need it using the commands I've just explained. That's it, 08:31
really. You can give it a try. I highly recommend 08:38
activating a firewall on your Linux system. This will make you even more secure against attacks from the internet 08:43
and provide you with additional protection. Be sure to check out my playlist. I recommend 08:49
following it from the beginning, as the individual videos build on each other. And if you 08:56
have a question and are stuck, visit our Telegram community. We're 09:01
guaranteed to help you there, and we're always there to listen. See you soon. Bye. 09:07

In diesem Video zeige ich euch, wie ihr euer Linux-System ganz einfach mit einer Firewall absichert. Mit diesen einfachen Schritten kannst du deine persönlichen Daten und dein System sicherer machen und Gefahren abwehren.

Ich stelle verschiedene Möglichkeiten vor, von der unkomplizierten Lösung mit ufw bis hin zu firewalld und klassischen Tools wie iptables oder nftables. Ihr erfahrt, wie ihr die Firewall aktiviert, Regeln für bestimmte Dienste oder Ports erstellt und den aktuellen Status überprüft.

Ich erkläre Schritt für Schritt, wie ihr Ports gezielt freigebt oder blockiert, Regeln dauerhaft speichert und welche Unterschiede es zwischen den Tools gibt. Für alle, die lieber eine grafische Oberfläche nutzen, zeige ich auch, wie ihr gufw installiert und bedient. So könnt ihr euer System flexibel und sicher schützen, egal ob im Terminal oder per Mausklick.

Nach dem Video wisst ihr, wie ihr eure Linux-Firewall einrichtet, anpasst und immer den Überblick über offene Verbindungen behaltet. Probiert es aus und teilt eure Erfahrungen gerne in der Community!

Navigation

Video Player