Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
01-17-2006, 07:20 AM
|
#1
|
Member
Registered: Aug 2005
Location: Tamil Nadu, India
Distribution: Redhat, Fedora
Posts: 120
Rep:
|
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
|
|
|
01-17-2006, 09:20 AM
|
#2
|
Member
Registered: Nov 2004
Location: ON, CANADA
Distribution: ubuntu, RHAS, and other unmentionables
Posts: 372
Rep:
|
|
|
|
01-25-2006, 03:45 PM
|
#3
|
LQ Newbie
Registered: Dec 2005
Posts: 5
Rep:
|
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
|
|
|
01-25-2006, 04:37 PM
|
#4
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep:
|
If you know the root password, just login as root and type passwd
|
|
|
01-25-2006, 05:08 PM
|
#5
|
LQ Newbie
Registered: Dec 2005
Posts: 5
Rep:
|
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
|
|
|
01-25-2006, 05:33 PM
|
#6
|
Senior Member
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141
Rep:
|
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";
|
|
|
All times are GMT -5. The time now is 05:11 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|