Results 1 to 10 of 11
I have a little problem here. From what I've learnt at internet to change the user account's password is like this (the user name is guest) :
usermod -p password ...
- 10-25-2008 #1
change user account password
I have a little problem here. From what I've learnt at internet to change the user account's password is like this (the user name is guest) :
But somehow, it still didn't change the password. Additional question, if we want to create a new account, we just need to type this, isn'tusermod -p password guest
Is there any mistakes on the syntax?useradd guest -p password
- 10-25-2008 #2
Try this
As root run the following command
passwd guest
This worked ok
useradd guest -p password
- 10-25-2008 #3Linux User
- Join Date
- Jun 2007
- Posts
- 318
If you use usermod to change a user's password the -p option requires you pass the encrypted password. That's why it didn't work, you didn't encrypt the password.
As TuxKnight suggested use the passwd command to change the user's password.
- 10-25-2008 #4forum.guy
- Join Date
- May 2004
- Location
- arch linux
- Posts
- 18,093
Here's a HowTo you can check for resetting both, root and user passwords:
http://www.linuxforums.org/forum/lin...-password.htmloz
→ new members/users: read this first | new member faq
→ no private messages requesting computer support - post them on the forums!
→ please use the "report post" button to alert our forum admins to problematic posts rather than responding to them yourself.
- 10-25-2008 #5
oh thanks everyone. Btw how do we get encrypted password then? Let's say if I want to use usermod -p , what should I do?
- 10-25-2008 #6
If you wanted to have an encrypted password, you're basically doing what the passwd tool does. Basically, given a string, you first select your encryption mechanism: either DES or MD5.
You then need to generate what is called a salt. This is a random sequence of characters that will be used to encrypt the password. You then employ the chosen encryption algorithm using the salt and the password to generate an encrypted password.
The only time that I've ever done this was for kicks and giggles, and it's fairly simple to use glibc functions for it (except for generating a secure salt: that's more complicated).DISTRO=Arch
Registered Linux User #388732
- 10-25-2008 #7Linux User
- Join Date
- Jun 2007
- Posts
- 318
You could use perl's crypt function to encrypt a password. Here's a very simple example:
The password is "abcdefg" and the salt is 756. You could use $RANDOM for the salt if you want.Code:#!/bin/bash -vx tmp="`perl -e 'print crypt("abcdefg",756);'`" usermod -p "$tmp" test
- 10-26-2008 #8
Ah.. I see..
but there is something I don't understand. The result of DES mechanism surely is different with MD5 isn't it? Let say I encrypt with DES mechanism, how can the Linux know that the password argument that I give is using DES Mechanism not MD5. Btw, when I login, I type the plain text, Linux need to convert it to the encrypt text first before comparing the word right?
- 10-26-2008 #9Linux User
- Join Date
- Jun 2007
- Posts
- 318
To the best of my knowledge Linux uses only DES in encrypting passwords. Perl's crypt function uses DES.
Linux Online - Password Security and Encryption
Not sure what Cadhan was talking about wrt MD5.
- 10-27-2008 #10
I read man, it said it can be md5, if we configure the pam. Talking about pam, is that a program? I have a little problem on that thing(I have posted it at Redhat).
Anyway thanks for the link.


Reply With Quote