LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   How to use "useradd" command correctly? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-use-useradd-command-correctly-171006/)

hus 04-16-2004 02:02 PM

How to use "useradd" command correctly?
 
In usual I use kuser ,the package come with KDE to
create user account.
But now I want to try in a non-graphical mode because
in my server did't have Desktop manager program.

My problem is

useradd -g root -s /bin/bash -p MyPasswd -d /home/tux tux

tux@darkstar:/$ passwd
Changing password for tux
Old password:
Incorrect password for `tux'
The password for tux is unchanged.

*****************************************

useradd tux2

tux2@darkstar:/$ passwd
The password for tux2 cannot be changed.

How to solve this?
Thanks for your suggestion.

AutOPSY 04-16-2004 02:39 PM

all you need to do is not add the -p switch:
useradd -g root -s /bin/bash -d /home/tux tux

then use the : passwd user command to set the password.

say you just created a user called tux. without the -p switch.

then use
passwd tux

and it will set the password.
-p expects an encrypted password.

jxi 04-16-2004 02:48 PM

the short answer is :
don't use the -p option in useradd

instead, as root, run useradd as above (without the -p My...)
then (still as root)
# passwd tux

you'll get a prompt for a new password followed by a confirmation prompt.

The -p option has a very specialized function which I can't quite recall but is typically for, say, a university server admin that needs to create a lot of accounts at one time.
HTH

struberg 05-12-2004 01:20 PM

u can fix your existing users if you call passwd (as root) this way

passwd [username]

to change your password withoug being asked for the users old password.

best regards,
strub


All times are GMT -5. The time now is 08:12 PM.