LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 07-14-2008, 06:19 AM   #1
dale_chip
Member
 
Registered: Jun 2007
Location: India
Posts: 41

Rep: Reputation: 15
grub single mode hack


i recently came to know that grub can be hacked to boot into as root by editing the command line.
i searched web to prevent such hacks and they all suggested to add a md5 password.
but the problem with that is that it asks for this password even when i try to boot.
i am looking out for a solution that only prevents people from hacking into the root account. i am using a shared computer so i must allow them to boot into with their respective accounts but not be able to hack into as root.
 
Old 07-14-2008, 01:23 PM   #2
makuyl
Senior Member
 
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
Perhaps use lock and see if the password is still asked at normal booting.
http://www.gnu.org/software/grub/man.../Security.html
 
Old 07-14-2008, 07:55 PM   #3
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
What do you mean by shared....a stand alone pc that different ppl sit at to login or do you mean that there are different network computers that share one computer for access?

lock and passwd for standalone and grub is irrelevant for the others but ssh may need hardening. I do not have such networks but Secure FTP over ssh is one way......running logins with chroot jails is another. There is a good post on that if you need it.

A determined local user can of course bypass the grub lock and passwd which is why I do not have it in my howto. But you have to have a certain level of trust for local users otherwise why allow them access to the computer in the first place?
 
Old 07-14-2008, 09:51 PM   #4
aus9
LQ 5k Club
 
Registered: Oct 2003
Location: Western Australia
Distribution: Icewm
Posts: 5,842

Rep: Reputation: Disabled
I suppose I should tell you the strongest way of doing it?

boot up the system
open a shell and get root powers (su or sudo whatever)

Code:
su
grub
md5crypt
(enter your password)
(do not quit until you have copy and pasted the result which is an encrypted password...Konsole uses can use Edit Copy
Also use root powers to edit /boot/grub/menu.lst

Create a blank line at top of file to insert new line
password --md5 (insert encrypted string here)

For each TITLE in menu....immediately below title create a new line called
lock

eg

--------
password --md5 $1$sL3Cb$44Iyndws/jLfgi6JYYHeo

blah blah

title
lock
root (hd0,0)
kernel /blah blah
initrd /blah blah

(2) if you need to edit menu at boot...just after mbr jumps to grub menu....press the P keyboard letter to enter password.

(3) To test that you can get in....first copy and paste your normal entry without a lock

so you have

title
lock
blah blah

title
blah blah

remove it after testing

cheerio
 
Old 07-15-2008, 07:15 AM   #5
dale_chip
Member
 
Registered: Jun 2007
Location: India
Posts: 41

Original Poster
Rep: Reputation: 15
thanx to all

@aus9 : the problem still persists
the grub does not allows to boot unless i press p and enter the password
 
Old 07-15-2008, 08:01 AM   #6
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Read carefully through the Grub manual - you can make it demand a password only before entering the command-line interactive mode; this allows you to select what to boot, but you can't change any boot parameters without the password.

Other tips:
http://wiki.linuxquestions.org/wiki/Securing_GRUB

On the other hand - what's the point? Unless you physically lock up the box and prevent anyone from booting from USB/external storage/CD, putting a password on Grub doesn't really achieve anything.
 
  


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
Can't boot in single user mode with GRUB on RedHat 9.0 stwo232 Linux - General 1 04-12-2006 06:18 PM
single user mode using grub dogma Linux - Newbie 4 09-02-2004 02:49 PM
single user mode in GRUB isaac_linux Linux - General 1 04-03-2004 09:27 AM
Single User Mode From GRUB medamnit Linux - Newbie 3 05-20-2002 05:08 AM
grub boot loader and single user mode midnightcommander Linux - General 1 04-02-2001 04:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 05:15 PM.

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