LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 01-17-2006, 07:20 AM   #1
ajkannan83
Member
 
Registered: Aug 2005
Location: Tamil Nadu, India
Distribution: Redhat, Fedora
Posts: 120

Rep: Reputation: 15
Root Password


Hello Friends

I am using Redhat Linux 9.0

I forgot my root password.

If anybody to know how to recover or change the root password.

Thank You
 
Old 01-17-2006, 09:20 AM   #2
nilleso
Member
 
Registered: Nov 2004
Location: ON, CANADA
Distribution: ubuntu, RHAS, and other unmentionables
Posts: 372

Rep: Reputation: 31
http://www.redhat.com/docs/manuals/l...escuemode.html
 
Old 01-25-2006, 03:45 PM   #3
cdnsupra
LQ Newbie
 
Registered: Dec 2005
Posts: 5

Rep: Reputation: 0
change root password

Hi, I have not lost my root password, but i do want to change it. Is there any problems or things to be aware of before I attempt this?

Is this the proper or prefered method?
I do not have any x-windows or gui shells installed. I do everything with putty.exe at the moment.
I found the following:

Python 2.2.2 (#1, Dec 10 2002, 09:57:09)
[GCC 3.2.1 20021207 (Red Hat Linux 8.0 3.2.1-2)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
At the prompt, type the following (replacing password with the password to encrypt and salt with a combination of exactly 2 upper or lower case alphabetic characters, digits, the dot (.) character, or the slash (/) character such as ab or 12:

import crypt; print crypt.crypt("password","salt")

The output is the encrypted password similar to 12CsGd8FRcMSM.

Type [Ctrl]-[D] to exit the Python interpreter.

Cut and paste the exact encrypted password output, without a leading or trailing blank spaces, into the following command:

usermod -p "encrypted-password" username
 
Old 01-25-2006, 04:37 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
If you know the root password, just login as root and type passwd
 
Old 01-25-2006, 05:08 PM   #5
cdnsupra
LQ Newbie
 
Registered: Dec 2005
Posts: 5

Rep: Reputation: 0
Quote:
Originally Posted by gilead
If you know the root password, just login as root and type passwd
Oh, OK. So i don't need to worry about all these password encryption protocols. I looked through "info" and "manual" last night, but did not see the command "passwd", and figured I had to do it through "usermod".

Thanks....Ben
 
Old 01-25-2006, 05:33 PM   #6
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
You can use usermod, but you have to use the encrypted password string instead of plain text. If you ever need to do it that way, I use the following to generate encrypted passwords for a CVS server at work (it takes the plain text password as an argument and outputs the encrypted password). It's from http://www.taursys.com/howto/cvs/ and is a bit simpler than the python code you have in the first post:

#!/usr/bin/perl

srand (time());
my $randletter = "(int (rand (26)) + (int (rand (1) + .5) % 2 ? 65 : 97))";
my $salt = sprintf ("%c%c", eval $randletter, eval $randletter);
my $plaintext = shift;
my $crypttext = crypt ($plaintext, $salt);

print "${crypttext}\n";
 
  


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
How could normal user obtain root password or change root password ckamheng Debian 18 02-18-2009 11:28 PM
Booting into Single User on MDK 9 asks for root password instead of booting into root acadcworks Linux - General 6 01-10-2006 07:51 AM
Root password!!! PLEASE HELP ME! savageculio Linux - General 2 11-23-2005 02:41 AM
Logged in as root, prompted for root password ta0kira Slackware 13 04-25-2005 02:29 AM
root password medamnit Linux - Newbie 15 05-27-2002 11:28 AM

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

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