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-24-2011, 06:30 PM   #1
gsingh100
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Rep: Reputation: Disabled
Unhappy Login issue when creating a new user


Hi, I"m trying to create a new user with the following useradd command,
Example:
useradd -c "Henry Shelton" -m -p "password" -s "/bin/bash" hshelton

Once created, when I try to login as a new user I can"t login in. The error message says login failed. I checked the shadow file and see that the password for the new user is not encrypted. Once I change the password and then try to login as a new user, it works. Can anyone help me in this? I am using OpenSuse11.4

Thanks

Gurpreet
 
Old 11-24-2011, 07:41 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.9, Centos 7.3
Posts: 17,374

Rep: Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383Reputation: 2383
See this page http://linux.die.net/man/8/useradd. As mentioned, if you use that technique, you have to supply a passwd already in encrypted form(!).
Normally you'd create the user without specifying the password, then just use the passwd cmd as root
Code:
passwd <newuser>
and supply the plaintext passwd twice at the prompts http://linux.die.net/man/1/passwd.
As it says, another option is to use --stcin like this
Code:
echo plaintext_passwd | passwd --stdin username

Welcome to LQ
 
Old 11-24-2011, 08:03 PM   #3
blue_print
Member
 
Registered: May 2010
Location: In world
Distribution: RHEL, CentOS, Ubuntu
Posts: 275
Blog Entries: 3

Rep: Reputation: 50
Remove setting password from useradd command. Try setting the password for the user as told by Chrism01.
 
Old 11-24-2011, 11:25 PM   #4
gsingh100
LQ Newbie
 
Registered: Nov 2011
Posts: 2

Original Poster
Rep: Reputation: Disabled
Yes that's is what I'm using as a workaround. But my concern was if there is any bug that the password is not encrypted while executing the useradd command or is it the standard procedure of creating the user, with useradd command without adding password. We have 120 users to create here and I wanted to setup a script. Anyway thanks for the help.
 
  


Reply


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
user login issue vivkepat Linux - Newbie 6 09-25-2010 12:21 AM
Creating user account which on login shuts down the computer lgp171188 Linux - Software 3 08-12-2009 11:25 PM
creating a new user with no login permissions matsko Linux - Software 8 04-24-2008 10:34 AM
Creating a user using numbers as login petkovsky Red Hat 3 09-21-2006 06:21 AM
FC4-test1 not creating a User Account - Cannot Login DigeratiPrime Fedora - Installation 1 03-17-2005 07:41 PM

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

All times are GMT -5. The time now is 02:13 AM.

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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration