Customizing boot-process and GRUB

Kernels & Hardware, configuring network, installing services

Customizing boot-process and GRUB

Postby Joost1985 » 2018-10-04 11:01

Dear all,

I have a fresh Debian Stretch install and I am trying to modify the boot process.
This is what I have in mind.

There are three options for booting:
    1. As a regular user (standard)
    2. As an administrator
    3. Password based

I would like to add these to Grub as menu entries, but I cannot seem to manage.
The resulting boot process should be as follows for the different options:
    1. The initramfs image should read a specific usb-device which has a key on it to unlock the encrypted devices and should login as the user which is set on the usb-device.
    2. The initramfs image should read the administrator usb-device and get the administrator skeleton-key to unlock all encrypted devices and login as administrator.
    3. This is a backup in case 1 and 2 fail s.t. you can unlock the encrypted devices by typing in a passphrase.
I would like to generate a different initrd image for all different options using scripts in /etc/initramfs-tools.

If you have a different solution feel free to let me know, however I am also interested in getting my option to work for my learning curve.
The next step is to automate the proces based on the (un)inserted specific usb-device.

In /boot I have three different images name: vmlinuz-4.9.0-4-686-pae(-pw / -user / -admin) and initrd.img-4.9.0-4-686-pae(-pw / -user / -admin).
I am trying to edit /etc/grub.d/40_custom for the menu entries, but cannot get it to work.
Posts: 1
Joined: 2018-10-04 10:42

Re: Customizing boot-process and GRUB

Postby GarryRicketson » 2018-10-04 12:22

I don't think the Grub boot menu is intended to be used this way.
You could have done some searches to confirm that:
what is Grub2 for
1 of many hits:
Grub is a boot menu, used to determine which system will boot, it does not determine who would log in. That is done after the system boots, and then the user has the login prompt, for a multi user system , you use the 'add user' or 'user add ' command. You could have 3 or even more users, 1. the normal user, whom is identified by a "username". You might even have several normal users, each one identified with the username.
The 2nd user, that is the admin, is still identified by the username, and has administrative privileges, the permissions are determined by what groups, and specific permissions are assigned to each user group.
what is the linux login prompt for
1 of many hits:
The rest, about the USB device and encryption are completely different topics, it is not good to ask multiple questions in 1 topic, because that results in a confusing topic, that is a mixed up thread on various topics.
Last but not least,
Post by Joost1985 » 2018-10-04 05:01

Dear all,

I have a fresh Debian Stretch install and I am trying to modify the boot process.
This is what I have in mind.

So, you have installed Debian, and it is working ? If so, you really need to learn more about your new Debian system, for example, adding users, groups,and setting permissions for each user, and then there is much more,...Have you read any of the Debian documentation ?
Any way, before you go and start messing around with Grub and the boot process, learn a little about Linux and you new Debian system. If what you are trying to do is set up a "multi boot" system, there is documentation on that, but the login is still the same, "root" can login as administrator, to do that the user must know the root password, the same , each user , must know thier password, if a user has the permissions, they can become root, using su or sudo, there is to much to say here, you really just need to do a lot of reading,and learn a little about Debian, and Linux first.
User avatar
Posts: 5877
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Return to System configuration

Who is online

Users browsing this forum: No registered users and 9 guests