12
edits
Charles-Elie (talk | contribs) (Created page with "Pare-feux") |
Charles-Elie (talk | contribs) (Created page with "Utiliser un pare-feu local est toujours une bonne pratique. Même si vous utiliser un pare-feu réseau, votre pare-feu local vous protège des menaces internes à votre réseau.") |
||
| Line 2: | Line 2: | ||
__TOC__ | __TOC__ | ||
= | =Aperçu= | ||
Utiliser un pare-feu local est toujours une bonne pratique. Même si vous utiliser un pare-feu réseau, votre pare-feu local vous protège des menaces internes à votre réseau. | |||
=UFW= | =UFW= | ||
| Line 10: | Line 10: | ||
UFW stands for Uncomplicated FireWall, and is a program for managing a netfilter firewall. It provides a command line interface and aims to be uncomplicated and easy to use. UFW is far simpler than iptables and a good place to start unless you have very specialized needs. | UFW stands for Uncomplicated FireWall, and is a program for managing a netfilter firewall. It provides a command line interface and aims to be uncomplicated and easy to use. UFW is far simpler than iptables and a good place to start unless you have very specialized needs. | ||
== | ==Installer UFW== | ||
You can install the {{ic|ufw}} package using you favorite package manager or the command: | You can install the {{ic|ufw}} package using you favorite package manager or the command: | ||
| Line 21: | Line 21: | ||
{{warning|Don't enable both iptables.service and ufw.service}} | {{warning|Don't enable both iptables.service and ufw.service}} | ||
== | ==Ajout d'une règle== | ||
Pour afficher la configuration actuelle, vous pouvez utiliser la commande suivante : {{ic|ufw status}}. Voici à quoi cela ressemble dans une nouvelle installation : | |||
{{UserCmdOutput|command=sudo ufw status verbose|result= | {{UserCmdOutput|command=sudo ufw status verbose|result= | ||
| Line 32: | Line 32: | ||
}} | }} | ||
Cela indique que le trafic entrant sera bloqué et que le trafic sortant sera autorisé. C'est un bon point de départ pour la plupart des systèmes de bureau. Cependant, il est souvent nécessaire d'autoriser une partie du trafic entrant. Pour ce faire, utilisez la commande suivante : {{ic|ufw allow}}.Par exemple, si nous voulons autoriser le trafic ssh entrant afin de pouvoir nous connecter à la machine à partir d'autres machines du réseau, nous pouvons utiliser la commande : | |||
{{UserCmd|command=sudo ufw allow ssh}} | |||
Si nous voulions également établir des connexions TCP vers un serveur Web local sur un port https 8443 (ce n'est pas le port standard pour https), nous pourrions utiliser la commande : | |||
{{UserCmd|command=sudo ufw allow in 8443/tcp}} | |||
{{tip|When you don't specify "in" or "out", "in" is assumed}} | {{tip|When you don't specify "in" or "out", "in" is assumed}} | ||
edits