Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 04-16-2004, 03:02 PM   #1
Registered: Dec 2003
Location: Bangkok- Thailand
Distribution: Mandriva 10.0,Fedora Core 4
Posts: 79

Rep: Reputation: 15
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.
Old 04-16-2004, 03:39 PM   #2
Registered: Mar 2004
Location: US
Distribution: Redhat 9 - Linux 2.6.3
Posts: 836

Rep: Reputation: 31
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.
Old 04-16-2004, 03:48 PM   #3
Registered: Feb 2003
Location: Richmond VA
Distribution: Slackware 11 -- CentOS 4.4
Posts: 115

Rep: Reputation: 15
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.
Old 05-12-2004, 02:20 PM   #4
LQ Newbie
Registered: May 2004
Location: vienna
Distribution: FC3
Posts: 17

Rep: Reputation: 0
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,


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
Shell Script: Find "Word" Run "Command" granatica Linux - Software 5 07-25-2007 08:42 AM
Tiny Sofa 2.0 - I thought "halt", "reboot" were only root command ?? sorcerer Linux - Distributions 1 08-21-2004 04:28 PM
"useradd: unable to lock password file" need help monzter Programming 1 08-16-2004 01:59 AM
useradd problem with period "." on RH9.0 atcg Linux - Distributions 0 01-02-2004 02:55 AM
"segmentation error" when issuing "useradd" command through terminal with RH 9.0 kaihuang Linux - General 0 10-22-2003 12:47 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:53 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration