# Nftables : Erreur SSH

**URL:** <https://www.debian-fr.org/t/nftables-erreur-ssh/85683>\
**Category:** Support Debian\
**Tags:** ssh\
**Created:** [Novembre 19, 2021, 11:40 UTC](https://www.debian-fr.org/t/nftables-erreur-ssh/85683 "2021-11-19T23:40:10Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![NicolasDev](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@NicolasDev](https://www.debian-fr.org/u/NicolasDev)\
**Post date:** [Novembre 19, 2021, 11:40 UTC](https://www.debian-fr.org/t/nftables-erreur-ssh/85683/1 "2021-11-19T23:40:10Z")

</div>

Salut !

J’ai un problème avec mon fichier /etc/nftables.conf  
Après avoir redémarrer le service Nftables, je n’arrive plus à accéder à mon serveur en SSH.  
Je suis sur un Debian 11 mis à jour avant la configuration du pare-feu.

Il y a bien les ; après chaque règles.  
J’empêche tous les paquets sauf ceux que j’autorise (loopback, dns, ping, http, https, ssh)  
3229 = ssh (port modifié dans /etc/ssh/sshd\_config, service ssh redémarrer avant la config du pare-feu)

```
table ip filter {
        chain input {
		type filter hook input priority 0;
                ct state established,related accept;
                iifname lo accept;
                ip protocol icmp accept;
                tcp dport 3229 accept;
                tcp dport {80, 443, 3306} accept;

		policy drop;
        }

        chain forward {
		type filter hook input priority 0; policy drop;
        }

        chain output {
		type filter hook input priority 0;
                ct state established,related accept;
                oifname "lo" accept;
		udp dport 53 accept;
		tcp dport {80, 443} accept;

		policy drop;
        }
}

table ip6 filter {
	chain input {
		type filter hook input priority 0; policy drop;
	}

	chain forward {
		type filter hook input priority 0; policy drop;
	}

	chain output {
		type filter hook input priority 0; policy drop;
	}
}

```

Merci pour vos réponses 😉

---

<div class="post-metadata">

**Author:** ![PascalHambourg](https://www.debian-fr.org/user_avatar/www.debian-fr.org/pascalhambourg/32/5837_2.png) [@PascalHambourg](https://www.debian-fr.org/u/PascalHambourg)\
**Post date:** [Novembre 20, 2021, 7:41 UTC](https://www.debian-fr.org/t/nftables-erreur-ssh/85683/2 "2021-11-20T07:41:44Z")

</div>

C’est normal, ça ?

> [@NicolasDev](#):
>
> chain **forward** {  
> type filter hook **input**
> 
> chain **output** {  
> type filter hook **input**

---

<div class="post-metadata">

**Author:** ![NicolasDev](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@NicolasDev](https://www.debian-fr.org/u/NicolasDev)\
**Post date:** [Novembre 20, 2021, 4:50 UTC](https://www.debian-fr.org/t/nftables-erreur-ssh/85683/4 "2021-11-20T16:50:26Z")

</div>

A l’installation du paquet Nftables, dans le fichier /etc/nftables.conf, il y a cette configuration par défaut `type filter hook input priority 0;` sur input, forward, output

---

<div class="post-metadata">

**Author:** ![PascalHambourg](https://www.debian-fr.org/user_avatar/www.debian-fr.org/pascalhambourg/32/5837_2.png) [@PascalHambourg](https://www.debian-fr.org/u/PascalHambourg)\
**Post date:** [Novembre 20, 2021, 5:35 UTC](https://www.debian-fr.org/t/nftables-erreur-ssh/85683/5 "2021-11-20T17:35:47Z")

</div>

Ce n’est pas ce que je constate dans le fichier nftables.conf par défaut : la chaîne forward est attachée au hook forward et la chaîne output est attachée au hook output.

---

<div class="post-metadata">

**Author:** ![NicolasDev](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@NicolasDev](https://www.debian-fr.org/u/NicolasDev)\
**Post date:** [Novembre 20, 2021, 5:48 UTC](https://www.debian-fr.org/t/nftables-erreur-ssh/85683/6 "2021-11-20T17:48:04Z")

</div>

Ha ouai 😅  
Je suis débutant avec Nftables.  
Merci 😉

---

<div class="post-metadata">

**Author:** ![PascalHambourg](https://www.debian-fr.org/user_avatar/www.debian-fr.org/pascalhambourg/32/5837_2.png) [@PascalHambourg](https://www.debian-fr.org/u/PascalHambourg)\
**Post date:** [Novembre 20, 2021, 6:31 UTC](https://www.debian-fr.org/t/nftables-erreur-ssh/85683/7 "2021-11-20T18:31:39Z")

</div>

Quel rapport avec la configuration par défaut de nftables ?

---

<div class="post-metadata">

**Author:** ![NicolasDev](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@NicolasDev](https://www.debian-fr.org/u/NicolasDev)\
**Post date:** [Novembre 20, 2021, 6:45 UTC](https://www.debian-fr.org/t/nftables-erreur-ssh/85683/8 "2021-11-20T18:45:13Z")

</div>

Bah quand on installe Nftables, j’ouvre le fichier Nftables.conf  
Et il y a  
type filter hook input priority 0; pour la chaîne input

J’ai dû copier coller ce code pour chaque chain.

---

<div class="post-metadata">

**Author:** ![PascalHambourg](https://www.debian-fr.org/user_avatar/www.debian-fr.org/pascalhambourg/32/5837_2.png) [@PascalHambourg](https://www.debian-fr.org/u/PascalHambourg)\
**Post date:** [Novembre 20, 2021, 7:17 UTC](https://www.debian-fr.org/t/nftables-erreur-ssh/85683/9 "2021-11-20T19:17:18Z")

</div>

Quelle drôle d’idée. Pourquoi avoir recréé les chaînes alors qu’elles existaient déjà ?

---

<div class="post-metadata">

**Author:** ![NicolasDev](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@NicolasDev](https://www.debian-fr.org/u/NicolasDev)\
**Post date:** [Novembre 20, 2021, 7:31 UTC](https://www.debian-fr.org/t/nftables-erreur-ssh/85683/10 "2021-11-20T19:31:07Z")

</div>

Je sais pas, j’ai refais un fichier Nftables.conf de zéro pour m’entraîner
