LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 05-12-2013, 10:31 PM   #1
conconga
LQ Newbie
 
Registered: Dec 2009
Posts: 22

Rep: Reputation: 1
prompt for a password at boot time


Hi all,

I want to get from user a passward during boot time. This is something similar to what cryptsetup does, pausing boot process and demanding a password. Does this have something to do with initramfs?

Thanks
 
Old 05-12-2013, 11:53 PM   #2
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
full disk encryption is what you are looking for. you might also look at your BIOS as it might have a boot loader p/w you can set as well.
 
Old 05-13-2013, 12:19 AM   #3
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
grub can also ask for a passwd
 
1 members found this post helpful.
Old 05-13-2013, 01:09 AM   #4
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
good to know chrism01
 
Old 05-13-2013, 05:47 AM   #5
conconga
LQ Newbie
 
Registered: Dec 2009
Posts: 22

Original Poster
Rep: Reputation: 1
Thank you! And how do I get a password during boot time like cryptsetup does? I just want to learn how it does...

Cheers!
 
Old 05-13-2013, 07:21 AM   #6
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
dont know cryptsetup, if you like that then use that. otherwise you have 3 options listed here. two are very simple to set and with a little googling im sure the 3rd option would not be that hard to figure out either.
 
Old 05-13-2013, 05:58 PM   #7
conconga
LQ Newbie
 
Registered: Dec 2009
Posts: 22

Original Poster
Rep: Reputation: 1
Nowhere I said I want to USE cryptsetup. I said "I want to get from user a password during boot time". Nowhere I said either I want to encrypt a hard disk. And surely I have already googled for my problem, and also searched here in LQ. All the answers I got here are useless, since they do not answer my actual question, and the last suggestion comes with the insinuation I did something wrong here... I apologize for this text; I have no intention of being rude. The point is that the question is open and maybe some expert would like to share with us his knowledge. Thanks.

Last edited by conconga; 05-13-2013 at 06:15 PM.
 
Old 05-13-2013, 07:06 PM   #8
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,360

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
If you mean what I think, then, as above, if you go into the BIOS, you should be able to set a passwd there.
It usually a matter of hitting the right key during BIOS start. If you watch the msgs closely, it should tell you which key.
If not, its often either the DEL key or an F key eg F2, F8. Try a few or google your HW/motherboard.
 
Old 05-13-2013, 10:48 PM   #9
lleb
Senior Member
 
Registered: Dec 2005
Location: Florida
Distribution: CentOS/Fedora/Pop!_OS
Posts: 2,983

Rep: Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551Reputation: 551
Quote:
Originally Posted by conconga View Post
Nowhere I said I want to USE cryptsetup. I said "I want to get from user a password during boot time". Nowhere I said either I want to encrypt a hard disk. And surely I have already googled for my problem, and also searched here in LQ. All the answers I got here are useless, since they do not answer my actual question, and the last suggestion comes with the insinuation I did something wrong here... I apologize for this text; I have no intention of being rude. The point is that the question is open and maybe some expert would like to share with us his knowledge. Thanks.

as stated above several times now. i do not know cryptsetup. if you want to use that, then bloody well do so and stop [Mod Edit] complaining about it.

for BIOS pass word, well duh get into the BIOS on the computer and set the bloody pass word. sorry, but that is 101 computer basic.

if you did google full disk encryption there are plenty of detailed step by step instructions out there on HOWTO properly setup and configure a system for full disk encryption. im not going to write yet an other one when there are so many very good ones out there with a simple GOOGLE.COM search:

https://www.google.com/search?q=howt...hrome&ie=UTF-8

there follow the bloody link.

if the answers are useless, then you have failed to perform any research on what you are asking. they are all very clear and simple.

Last edited by onebuck; 05-14-2013 at 07:12 AM. Reason: Mod edit to remove obscene language,LQR violations
 
Old 05-14-2013, 07:17 AM   #10
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Moderator Response

@lleb

Please refrain from using profanity when posting. You should consider re-reading LQ Rules to refresh your understanding.

Your post was Moderator edited to remove offensive language.
 
Old 05-14-2013, 07:53 AM   #11
conconga
LQ Newbie
 
Registered: Dec 2009
Posts: 22

Original Poster
Rep: Reputation: 1
Thank you, Onebuck! The text, rude, does not answer anything. I, as much as lleb, still do not know how cryptsetup could interrupt the boot process, asks for a password, and use it to unlock a partition. If somebody can clarify, some light would be great!
 
Old 05-14-2013, 09:18 AM   #12
onebuck
Moderator
 
Registered: Jan 2005
Location: Central Florida 20 minutes from Disney World
Distribution: SlackwareŽ
Posts: 13,925
Blog Entries: 44

Rep: Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159Reputation: 3159
Member Response

Hi,
Quote:
Originally Posted by conconga View Post
Thank you, Onebuck! The text, rude, does not answer anything. I, as much as lleb, still do not know how cryptsetup could interrupt the boot process, asks for a password, and use it to unlock a partition. If somebody can clarify, some light would be great!
lleb, content was possible solution, just not composed following LQR guidelines.

Look at 'man crypsetup'.
 
Old 05-14-2013, 10:56 AM   #13
Janus_Hyperion
Member
 
Registered: Mar 2011
Location: /
Distribution: Fedora (typically latest release or development release)
Posts: 372

Rep: Reputation: Disabled
Fedora, openSUSE and Ubuntu installers offer GUI for setting up installations on encrypted partitions which will eventually ask for password at the time of booting. Arch and Slackware - you can setup using CLI.

Here is a sample. This is how I usually setup encrypted storage. A similar sequence can be used to install Linux on encrypted partitions as well.

Code:
$ su -
[root password]
PHP Code:
cryptsetup -c enc -s num -h hash luksFormat /dev/sd*

cryptsetup luksOpen /dev/sdlabel
mkfs.ext4 --m 1 /dev/mapper/label

mount /dev/mapper/label mount_location
chown -R user:user mount_location 
There are many aspects of the code above that needs understanding. This is not a fix-all solution. Make sure you read the manual pages before attempting this.

Caution:
Also remember, encrypting a hard drive will completely destroy the data on that hard drive.

Hope this helps.
 
Old 05-14-2013, 02:18 PM   #14
Z038
Member
 
Registered: Jan 2006
Location: Dallas
Distribution: Slackware
Posts: 912

Rep: Reputation: 174Reputation: 174
conconga, my understanding of your question is that you'd like to know how to get control early during the boot process to prompt a user for a password. You used LUKS as an example, but you've stated that you aren't asking how to implement LUKS encryption and don't wish to do so. You just want to know how LUKS does it so you can possibly do the same. Do I have that right?

Can you tell me what problem you are trying to solve? Why do you want to prompt the user for a password during the boot process?

The reason I ask is because most methods of password-protecting a system from being booted can be defeated fairly easily. For example:

1) A boot password set in BIOS can be defeated by clearing the BIOS CMOS. Many motherboards have a jumper that can be shorted to do this, and on some, removing the battery will do the same thing. You can then boot the system and login as usual.

2) A password set in a boot loader, like GRUB or lilo, can be defeated by booting Linux in single user mode. Both GRUB and lilo give you a means to do this. You'll be booted to a non-password protected root command prompt. You can then mount the hard drives and access all the data.

3) Boot the system from a Live CD, which normally gives you a non-password protected root command prompt. You can then mount the hard drives if the Live CD didn't already do it for you, and access all the data.

4) Boot an Linux installation CD. Most of them let you boot to a non-password protected root command prompt. Then proceed as in example 2 or 3.


If you are trying to prevent an unsophisticated user from booting the system, then a BIOS password or a boot loader password may be OK for you. Prompting a user during boot like LUKS does can be defeated by examples 2, 3, and 4 above. The LUKS password prompt can be avoided at boot time too in the same way, but no one will be able to access the encrypted filesystem until it is mounted and unlocked. LUKS will still get control to prompt for the password.

If you are interested in preventing unauthorized access to data on the system, then you really should consider full disk encryption for all partitions, including your swap partitions. At the minimum, you should encrypt the filesystem that contains /home and any other sensitive directories. If you do that, then LUKS will give you the password prompt during boot that you want, and you won't have to roll your own.

As for what you'd do if you still want to roll your own, I can't help you there, but I'm sure there are some who can if you keep searching and asking.

I apologize if I've still managed to misunderstand your objective.
 
Old 05-14-2013, 06:22 PM   #15
conconga
LQ Newbie
 
Registered: Dec 2009
Posts: 22

Original Poster
Rep: Reputation: 1
Quote:
Originally Posted by Z038 View Post
conconga, my understanding of your question is that you'd like to know how to get control early during the boot process to prompt a user for a password. You used LUKS as an example, but you've stated that you aren't asking how to implement LUKS encryption and don't wish to do so. You just want to know how LUKS does it so you can possibly do the same. Do I have that right?
That's the point. I see, by what appears on the monitor, that init has taken control. That is, the kernel is up. But it stops the process and requests a password at a time, I guess, X is not up yet. How? And how does it use the keyboard then?

Moreover, it works for all kernels I have. It does not matter if I change or recompile. It will still hang the boot.

Quote:
Originally Posted by Z038 View Post
Can you tell me what problem you are trying to solve? Why do you want to prompt the user for a password during the boot process?
None. I am just curious, trying to learn something interesting and new. This is the best thing about open-source life-style!

Thanks for your explanation about desktop-station-security. I have some cryptography here, but I see there are concepts to improve.

Regards!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Why am I being prompted for a grub user and password each time I boot? quarlington Fedora 1 07-17-2012 03:28 PM
Loading encrypted filesystem password over LAN at boot time? rjlee Linux - Security 4 07-12-2008 03:15 PM
No prompt after kernel/module messages at boot time m4mach Linux From Scratch 4 08-14-2007 05:04 AM
Does not prompt for password ssharma_02 Linux - Security 6 06-02-2005 01:51 AM
no password prompt stroh78 Linux - General 3 01-02-2001 09:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:50 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration