LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 02-07-2005, 11:03 AM   #1
chamalsl
LQ Newbie
 
Registered: Jan 2005
Posts: 11

Rep: Reputation: 0
Recovering Linux Password.


Hi,

I changed my linux root password. But now I can't remember the new password and I can't do any aministrative tasks.

But I still have my normal user account. Is there a way that I can recover my root password or will I have to reinstall linux again.

Best regards,
chamal.
 
Old 02-07-2005, 12:20 PM   #2
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
AFAIK you can do it 3 ways:
-you remember the password
-try to crack the password file with something like Jack the Ripper
-easily change it if you have a rescue disk like Knoppix

See which one suits you best and let us know. Anyway, maybe somebody has other suggestions.
 
Old 02-07-2005, 12:32 PM   #3
kbrooks
LQ Newbie
 
Registered: Feb 2005
Location: TN
Distribution: aix,sco,redhat,xp,server2003
Posts: 9

Rep: Reputation: 0
try this

this is what i do . hope it helps.

On an x86 system using GRUB as the boot loader, use the following steps to boot into single-user mode:

1.

If you have a GRUB password configured, type p and enter the password.
2.

Select Red Hat Enterprise Linux with the version of the kernel that you wish to boot and type a to append the line.
3.

Go to the end of the line and type single as a separate word (press the [Spacebar] and then type single). Press [Enter] to exit edit mode.
4.

Back at the GRUB screen, type b to boot into single-user mode.


then passwd root
and change it.
 
Old 02-10-2005, 10:30 AM   #4
wesleywest
Member
 
Registered: Aug 2004
Posts: 43

Rep: Reputation: 15
this is real easy!

step 1
download a iso of KNOPPIX distro of linux

step 2
burn it on cd

step 3
boot from cd

step 4
when o.s. is loaded open command shell

step 5
type in commandshell : su
now you a root users

step 6
in commandshell: mkdir /mnt/temp

step 7
typ in commandshell: fdisk -l /dev/hda
now take a look to see what is you / harddisk

step 8
in commandshell: mount /dev/hd* /mnt/test ( where * is your / as listed in fdisk -l /dev/hda)

step 9
vi /mnt/test/etc/passwd

step 10
delete the password line from the root to nothing

step 11
reboot and your done
 
Old 02-10-2005, 10:45 AM   #5
chamalsl
LQ Newbie
 
Registered: Jan 2005
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks a lot guys

Hi people,

Thanks a lot for your help. It really was very useful.

I was planning to reinstall linux, But your advice saved me a lot of time and from trouble.

Best regards,
Chamal.

Last edited by chamalsl; 02-10-2005 at 10:47 AM.
 
Old 02-10-2005, 01:18 PM   #6
harken
Member
 
Registered: Jan 2005
Location: Between the chair and the desk
Distribution: Debian Sarge, kernel 2.6.13
Posts: 666

Rep: Reputation: 30
It can be done in only 3 steps using Knoppix:

1.'mount -t ext3 /dev/hdN /mnt/hdN'

2.'chroot /mnt/hdN /bin/bash'

3.'passwd root'

where hdN is the partition where '/' is mounted.

That's all.
 
Old 02-14-2005, 11:16 AM   #7
adityabhat2
LQ Newbie
 
Registered: Feb 2005
Posts: 12

Rep: Reputation: 0
if u dont have grub password set it is very easy

step 1

when the grub loads just click on the linux o.s and press
"e" for edit

step 2
go the line
kernel ....................
press enter
at the end of line leave a single space and type single

step 3
go back to the grub
and load
u will get
sh# passwd root
and change the password
 
  


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
recovering root password isaacvimal Red Hat 3 04-02-2005 08:47 AM
How can I change e-mail password(or linux account password) with php in website?? yusuf Programming 1 05-28-2004 09:39 AM
Recovering XP Password using Knoppix doctor_damien Linux - Newbie 6 05-03-2004 03:09 AM
Recovering Lost Admin. Password Mr Neroazzurri Linux - Security 4 03-14-2003 05:26 PM
recovering root password in rh using lilo farhan Linux - General 1 03-01-2003 08:45 PM

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

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