LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 11-27-2007, 01:18 PM   #1
mcaywood
LQ Newbie
 
Registered: Jul 2007
Posts: 4

Rep: Reputation: 0
Password issues with useradd command


useradd SamIam -p pokey1

I have successfuly used the above command except when I try to log onto this new user and enter the password it tells me that I have entered an incorrect password. When I try the su command from a user account, I get the same message. I can go into the GUI side and change the password then I am able to log onto this new account. Any ideas??
 
Old 11-27-2007, 01:28 PM   #2
druuna
LQ Veteran
 
Registered: Sep 2003
Posts: 10,532
Blog Entries: 7

Rep: Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405Reputation: 2405
Hi,

As stated in the useradd manpage:
Quote:
-p, --password PASSWORD
The encrypted password, as returned by crypt(3).
Use the passwd command to set/change the users password.

You could also create a small binary yourself using the crypt() function. I just answered a similar question.

Hope this helps
 
Old 11-27-2007, 04:29 PM   #3
matthewg42
Senior Member
 
Registered: Oct 2003
Location: UK
Distribution: Kubuntu 12.10 (using awesome wm though)
Posts: 3,530

Rep: Reputation: 65
You can use the makepasswd program (you will probably need to install it) to create an encrypted password from a plaintext one.

You should never use a plaintext password on the command line as an argument to a command since this can be easily seen by any user on the system who runs ps at the right moment. You might be the only user on the system, but if you get into the habit you will probably continue it when you should not, so don't.

The plaintext password should be read from the keyboard (so you might as well use the passwd program), or - if you must automate the process - from the file with the permissions set so only the root user can read it.

See this thread for an example of how to use makepasswd: http://www.linuxquestions.org/questi...8/#post2969056
 
  


Reply

Tags
makepasswd, password, ps, useradd, usermod


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
generate a password string to be used by the useradd command powah Linux - Security 9 06-27-2023 06:23 AM
useradd -p <encrypted password> jeewiz Linux - Newbie 1 01-19-2007 08:17 AM
useradd without shadow password twallstr Linux - Software 1 09-08-2005 02:14 PM
Password Problems With useradd Jude Lucien Debian 4 08-18-2005 10:44 AM
set logon password without useradd? ldp Linux - Security 2 01-22-2005 07:12 PM

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

All times are GMT -5. The time now is 11:07 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