Hier werden die Unterschiede zwischen zwei Versionen gezeigt.
Beide Seiten, vorherige Überarbeitung Vorherige Überarbeitung Nächste Überarbeitung | Vorherige Überarbeitung Nächste Überarbeitung Beide Seiten, nächste Überarbeitung | ||
admin_grundlagen:bootloader [2016/06/01 13:42] ingo_wichmann [Grub2 mit Passwort absichern] |
admin_grundlagen:bootloader [2019/03/20 17:12] stefan_miethke |
||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
====== Bootloader ====== | ====== Bootloader ====== | ||
===== Bootloader löschen ===== | ===== Bootloader löschen ===== | ||
- | dd if=/dev/zero of=/dev/sda bs=446 count=1 | + | dd if=/dev/zero of=/dev/sda bs=$((512-64)) count=1 |
===== grub2 ===== | ===== grub2 ===== | ||
Zeile 37: | Zeile 37: | ||
==== Grub2 mit Passwort absichern ==== | ==== Grub2 mit Passwort absichern ==== | ||
=== Root Passwort ändern === | === Root Passwort ändern === | ||
- | Grub Bootprompt: ''init=/bin/bash'' hinzufügen | + | Grub Bootprompt: ''init=/bin/bash'' als Parameter zum Linux Kernel hinzufügen |
Kernel mit ''strg+x'' booten | Kernel mit ''strg+x'' booten | ||
Zeile 43: | Zeile 43: | ||
mount -o remount,rw / | mount -o remount,rw / | ||
passwd | passwd | ||
+ | |||
+ | touch /.autorelabel | ||
+ | |||
+ | ((nur bei Systemen mit aktiviertem SELinux notwendig)) | ||
+ | |||
mount -o remount,ro / | mount -o remount,ro / | ||
exec /sbin/init | exec /sbin/init | ||
=== Grub absichern === | === Grub absichern === | ||
- | Debian 6.0, CentOS 7: | + | == Passwort Hash erzeugen == |
+ | Debian 6, CentOS 7: | ||
grub2-mkpasswd-pbkdf2 | grub2-mkpasswd-pbkdf2 | ||
- | Debian 7, Ubuntu (ab 14.04): | + | Debian (ab 7), Ubuntu (ab 14.04): |
grub-mkpasswd-pbkdf2 | grub-mkpasswd-pbkdf2 | ||
+ | == Passwort Hash eintragen == | ||
<file txt /etc/grub.d/45_password> | <file txt /etc/grub.d/45_password> | ||
#!/bin/sh | #!/bin/sh | ||
Zeile 65: | Zeile 72: | ||
chmod +x /etc/grub.d/45_password | chmod +x /etc/grub.d/45_password | ||
+ | == grub Konfigurationsdatei neu erzeugen == | ||
Debian (ab 6), Ubuntu (14.04): | Debian (ab 6), Ubuntu (14.04): | ||
grub-mkconfig -o /boot/grub/grub.cfg | grub-mkconfig -o /boot/grub/grub.cfg | ||
Zeile 70: | Zeile 78: | ||
CentOS (7): | CentOS (7): | ||
grub2-mkconfig -o /boot/grub2/grub.cfg | grub2-mkconfig -o /boot/grub2/grub.cfg | ||
+ | |||
+ | == Auswahl ermöglichen, editieren absichern == | ||
+ | <file txt /etc/grub.d/10_linux> | ||
+ | ... | ||
+ | CLASS="--class gnu-linux --class gnu --class os --unrestricted" | ||
+ | ... | ||
+ | </file> | ||
== testen == | == testen == | ||
Zeile 87: | Zeile 102: | ||
oder | oder | ||
grub | grub | ||
+ | device (hd0) /dev/sda | ||
root (hd0,0) | root (hd0,0) | ||
setup (hd0) | setup (hd0) | ||
Zeile 97: | Zeile 113: | ||
oder | oder | ||
grub | grub | ||
+ | device (hd0) /dev/sda | ||
root (hd0,0) | root (hd0,0) | ||
setup (hd0) | setup (hd0) | ||
Zeile 131: | Zeile 148: | ||
===== Dokus & Links ===== | ===== Dokus & Links ===== | ||
* http://wiki.ubuntuusers.de/grub_2/konfiguration | * http://wiki.ubuntuusers.de/grub_2/konfiguration | ||
+ |