LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-10-2013, 05:23 PM   #1
sudo_su
Member
 
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 59

Rep: Reputation: Disabled
How to copy password generated by grub-md5-crypt


I am physically logged into my linux and had generated the grub password via below command
Quote:
grub-md5-crypt
but dont know how to copy the encrypted line so that I can paste it into grub configuration file :S

Last edited by sudo_su; 10-10-2013 at 05:28 PM.
 
Old 10-10-2013, 07:18 PM   #2
aus9
LQ Guru
 
Registered: Oct 2003
Posts: 5,124

Rep: Reputation: Disabled
sometime it helps if you mention you have grub legacy and not grub2.

https://wiki.archlinux.org/index.php...ord_protection
 
Old 10-10-2013, 11:57 PM   #3
ilesterg
Member
 
Registered: Jul 2012
Distribution: CentOS, SLES, RHEL, HP-UX, OpenSUSE Tumbleweed KDE
Posts: 504

Rep: Reputation: 54
What editor are you using? If you're using a shell on a GUI, you can just normally right click+highlight+copy the line and paste it in the config file using a text editor or something like.

Cheers.
 
Old 10-11-2013, 03:18 AM   #4
sudo_su
Member
 
Registered: Aug 2012
Location: Australia
Distribution: Redhat, CentOS
Posts: 59

Original Poster
Rep: Reputation: Disabled
I dont have GUI on system. I am logged in at tty and using vi editor.
 
Old 10-11-2013, 04:12 AM   #5
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387Reputation: 2387
Quote:
Originally Posted by sudo_su View Post
I dont have GUI on system. I am logged in at tty and using vi editor.
Install gpm. gpm is a cut and paste utility and mouse server for virtual consoles.

If installing gpm isn't an option:
- Append all the output to bottom of the configuration file: grub-md5-crypt | tee -a name.config.file

- And you can also run the grub-md5-crypt command from within vi (:r ! grub-md5-crypt). This does have a possible downside; You'll have to type the password blind (no prompts visible).

Both of the above 2 workarounds put all the output into the configuration file, but removing the first lines shouldn't be a problem.
 
Old 10-11-2013, 04:14 AM   #6
ilesterg
Member
 
Registered: Jul 2012
Distribution: CentOS, SLES, RHEL, HP-UX, OpenSUSE Tumbleweed KDE
Posts: 504

Rep: Reputation: 54
yank and paste should do the trick
 
Old 10-11-2013, 04:23 AM   #7
SAbhi
Member
 
Registered: Aug 2009
Location: Bangaluru, India
Distribution: CentOS 6.5, SuSE SLED/ SLES 10.2 SP2 /11.2, Fedora 11/16
Posts: 664

Rep: Reputation: 80
a simple option i saw above: redirect it to the end of the file as described above, that ways you can easily use it wherever you want it in the same file.
 
Old 10-11-2013, 05:46 AM   #8
ilesterg
Member
 
Registered: Jul 2012
Distribution: CentOS, SLES, RHEL, HP-UX, OpenSUSE Tumbleweed KDE
Posts: 504

Rep: Reputation: 54
Quote:
Originally Posted by SAbhi View Post
a simple option i saw above: redirect it to the end of the file as described above, that ways you can easily use it wherever you want it in the same file.
another thing you can try is

Code:
grub-md5-crypt >> /boot/grub/grub.conf
or to your config file (menu.lst ?). Then manually type the hash

Code:
password-md5 hash
 
Old 10-11-2013, 05:58 AM   #9
mddnix
Member
 
Registered: Mar 2013
Location: Bangalore, India
Distribution: Redhat, Arch, Ubuntu
Posts: 512

Rep: Reputation: 139Reputation: 139
Here is another solution:

script:
PHP Code:
##!/bin/bash
grub=/boot/grub/grub.conf
var=$(openssl passwd -1)
echo 
password --encrypted $var >> $grub 
line will be appended to last line. just dd and p it before title.
Code:
password --encrypted $1$mKUxHB/k$atUv6Wqvh1WoLUHgLf/be0
title CentOS (2.6.32-358.11.1.el6.x86_64)
	root (hd0,0)
	kernel /vmlinuz-2.6.32-358.11.1.el6.x86_64 ro root=/dev/mapper/vg_centos64-lv_root rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD rd_LVM_LV=vg_centos64/lv_root SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_LVM_LV=vg_centos64/lv_swap  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM quiet
	initrd /initramfs-2.6.32-358.11.1.el6.x86_64.img
Source: http://www.linuxforums.org/forum/pro...able-grub.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
[SOLVED] BIOS Password and GRUB md5 Ztcoracat Linux - Security 5 09-01-2012 10:28 PM
[SOLVED] Help in understanding md5 password placement in grub.. infinite_scale Linux - Newbie 3 07-30-2011 10:48 AM
grub-md5-crypt question dudepigeon Linux - General 1 07-24-2009 09:19 AM
grub-md5-crypt granny Linux - Security 3 01-24-2006 02:20 PM
Does AIX5.2 use crypt or md5 synthol6 AIX 1 07-26-2004 09:08 AM


All times are GMT -5. The time now is 08:19 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration