# Échec pour sécuriser GRUB avec un mot de passe

**URL:** <https://www.debian-fr.org/t/echec-pour-securiser-grub-avec-un-mot-de-passe/91404>\
**Category:** Support Debian\
**Tags:** grub\_mkpassword-pbkd, grub\
**Created:** [Août 9, 2025, 5:21 UTC](https://www.debian-fr.org/t/echec-pour-securiser-grub-avec-un-mot-de-passe/91404 "2025-08-09T17:21:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Zargos](https://www.debian-fr.org/user_avatar/www.debian-fr.org/zargos/32/10889_2.png) [@Zargos](https://www.debian-fr.org/u/Zargos)\
**Post date:** [Août 9, 2025, 5:21 UTC](https://www.debian-fr.org/t/echec-pour-securiser-grub-avec-un-mot-de-passe/91404/1 "2025-08-09T17:21:13Z")

</div>

Bonjour,  
j’essaye de mettre un mot de passe sur grub.  
Bien que je fasse ce qui est nécessaire, ça ne marche absolument pas…  
Je fait pourtant ce qu’il faut:

```auto
~# grub-mkpasswd-pbkdf2
Entrez le mot de passe : 
Entrez de nouveau le mot de passe : 
Le hachage PBKDF2 du mot de passe est grub.pbkdf2.sha512.10000.100B8D2FC5FFB9584118176C2CE8E432753CC69949E5139ADCC565533732B5C2DC3F65E7FE8506CBC4B89F458F42F45444F542F9D526AC88C6DA7D44F537A276.38B0B6565DBF87D30091956FA0E9FCC2250E3B47356545FF28314800D47D68352DD14108527C0AB75F3340F2E92046A441693A07CB42CE92933D20AF8482901D

```

Puis je modifie la configuration grub:

```auto
~# vim /etc/grub.d/40_custom 

```

Avec:

```auto
~# cat /etc/grub.d/40_custom 
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
set superuser="root"
password_pbkdf2 root grub.pbkdf2.sha512.10000.100B8D2FC5FFB9584118176C2CE8E432753CC69949E5139ADCC565533732B5C2DC3F65E7FE8506CBC4B89F458F42F45444F542F9D526AC88C6DA7D44F537A276.38B0B6565DBF87D30091956FA0E9FCC2250E3B47356545FF28314800D47D68352DD14108527C0AB75F3340F2E92046A441693A07CB42CE92933D20AF8482901D

```

Enfin pour finir:

```auto
~# update-grub
Generating grub configuration file ...
Found theme: /boot/grub/themes/enedwaith/theme.txt
Found linux image: /boot/vmlinuz-6.1.0-37-amd64
Found initrd image: /boot/initrd.img-6.1.0-37-amd64
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
done
~# chkboot -u

```

Quand je redémarre, ça ne marche pas, je peux modifier la ligne de commande du démarrage.  
Il n’en tient absolument pas compte…

---

<div class="post-metadata">

**Author:** ![Anonymous23](https://www.debian-fr.org/letter_avatar_proxy/v4/letter/a/90ced4/32.png) [@Anonymous23](https://www.debian-fr.org/u/Anonymous23)\
**Post date:** [Août 9, 2025, 8:38 UTC](https://www.debian-fr.org/t/echec-pour-securiser-grub-avec-un-mot-de-passe/91404/2 "2025-08-09T20:38:05Z")

</div>

bonsoir @Zargos

c’est normal ce «&nbsp;\*&nbsp;» avant `*#!/bin/sh`

---

<div class="post-metadata">

**Author:** ![Zargos](https://www.debian-fr.org/user_avatar/www.debian-fr.org/zargos/32/10889_2.png) [@Zargos](https://www.debian-fr.org/u/Zargos)\
**Post date:** [Août 10, 2025, 4:32 UTC](https://www.debian-fr.org/t/echec-pour-securiser-grub-avec-un-mot-de-passe/91404/3 "2025-08-10T04:32:01Z")

</div>

> [@Anonymous23](#):
>
> c’est normal ce « \* » avant `*#!/bin/sh`

Non c’est une erreur de transcription sur debian-fr 🙂 Dans le fichier c’est bon et dans le grub.cfg résultant aussi.
