LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-28-2006, 10:55 PM   #1
pistolguy
LQ Newbie
 
Registered: Feb 2006
Posts: 3

Rep: Reputation: 0
Reading Files in USB during boot time


I'm trying to implement a security module, using partly the root plug module, where I want to read-write a password in a USB flash key and take the appropriate decisions if the pass is right or not.
I've read that reading files from a disk in kernel mode is not a good thing to do.
So which is the right and secure way to do that? Can I just use bash scripting to read from usb and somehow pass the data to the kernel module? Maybe what I said is bull%@*t, I'm just trying to make a plan of how to work around this.. I suppose it's not secure to have the cryptography algorithm in plain text inside a script..
I just don't know where to focus my work because I don't really have a global perception about how exactly the kernel works.
Do you have any suggestions?
Thank you
 
Old 03-01-2006, 04:48 PM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
At what point do you need the USB device? I use one with my system, but I hold off until right before login to use it (I need it for /home and a few non-standard mounts, but not the basic ones.) If you don't need it before /etc and fstab are processed, I'd suggest waiting until the last minute. If you can wait until / is mounted, either compile your kernel with USB support, or load the usb-storage module early on (rc.modules in Slackware.) If you can't wait until / is mounted, you (almost) definitely need to use an initrd, which is a pain in the ass. I've never had the patience to figure out setting one of those up.

BTW Yes, scripts work very well for this purpose. The exception is if you've encrypted the USB device and/or it cannot otherwise be found using findfs. You can explicitly specify the device name to mount, however all peripheral devices must be connected exactly the same (with the same kernel) every boot for that to work reliably. Also, on one of my systems the PCMCIA controller seems to get in the way so I have to wait until hotplug is done before I plug it in.
ta0kira
 
Old 03-02-2006, 11:02 AM   #3
pistolguy
LQ Newbie
 
Registered: Feb 2006
Posts: 3

Original Poster
Rep: Reputation: 0
Thanks for the advice, I searched more on the subject and I think I can use more bash scripting than kernel programming to do what I want.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
loading the USB module at boot time marc1978 Linux - Hardware 2 10-31-2005 06:11 PM
Usb External Harddrive - Extremely slow when reading files. RoaCh Of DisCor Linux - Hardware 1 04-26-2005 06:14 AM
Help...usb problem on boot time jiman Fedora 4 10-08-2004 02:15 AM
USB controllers get deregistered at boot time gary.chan Linux - Hardware 0 08-16-2003 11:00 PM
Similar usb-uhci hanging at boot time problem GrayGh0st Linux - Hardware 16 06-24-2003 04:26 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:32 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