Is there any way to lock a Windows or Linux machine’s boot.
eg. You press the power button on a PC and it asks for a password before booting to the OS.
There are a number of methods to secure a computer before the OS boots.
BIOS passwords. Almost every BIOS on a consumer motherboards come with a password feature. Upon starting the computer, the BIOS will ask for a password. The machine will not continue to boot until the proper password is entered. Note: BIOS passwords can typically be bypassed by a technically knowledgeable person.
Hardware based hard drive encryption. Some hard drives offer built in encryption with a password on boot. These are extremely secure and work with any operating systems.
Software based hard drive encryption. This works similarly or in conjunction with hardware based hard drive encryption. These are extremely secure and work with many different operating systems. Examples include Windows Bitlocker and Veracrypt. You will need to check compatibility with your operating system.
WARNING: Implementing any of these security features and forgetting your password could result in you permanently losing access to your operating system and data.