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

Tags: #<Tag:0x00007fe4c7751c10> #<Tag:0x00007fe4c7751a80>

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:

~# 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:

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

Avec:

~# 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:

~# 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…

bonsoir @Zargos

c’est normal ce « * » avant *#!/bin/sh

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