LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 04-16-2004, 02:02 PM   #1
hus
Member
 
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, 02:39 PM   #2
AutOPSY
Member
 
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, 02:48 PM   #3
jxi
Member
 
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.
HTH
 
Old 05-12-2004, 01:20 PM   #4
struberg
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,
strub
 
  


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:49 PM.

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