LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 02-02-2012, 11:12 PM   #1
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Rep: Reputation: Disabled
Smile User login problem.


Hi,

I'm new to LQ. First time I'm posting my thread. I'm using RHEL 5 OS and I faced this problem while creating a new user:
I created a new user by adding the following line to the /etc/passwd file

Quote:
bobm::501:501:Bob Morris:/home/bobm:/bin/bash
I then created the user’s home directory and use the passwd command to set his password. However, I'm unable to log on through that user. What could be the problem?

Last edited by Nitin Chaudhary; 02-02-2012 at 11:14 PM.
 
Old 02-02-2012, 11:23 PM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Depends on the exact error msg you get.
Have you checked the ownerships & perms on the home dir?
Is this a standalone system or does it use distributed logins eg LDAP/NIS ?

To be honest, its probably going to be quicker to delete that stuff and use the proper tool
http://linux.die.net/man/8/useradd

Just do
Code:
useradd -c "Bob Morris" bobm 
passwd bobm
The default settings should give you more or less the same as you tried to specify, assuming you haven't changed them since the install.
 
Old 02-02-2012, 11:38 PM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
or if this is NOT a text only server and you are using Gnome
then use the gui tool there on the menu
System /Administration /add user

you also might want to READ the red hat documentation
https://access.redhat.com/knowledge/...erprise_Linux/
the older RHEL 5 is in the middle

Also I RECOMMEND searching the red hat knowledge base
The FULL instructions are in there
https://access.redhat.com/knowledge/search
Now you WILL have to login to red hat with the username and password you set up when you bought the REQUIRED support contract
 
Old 02-03-2012, 12:12 AM   #4
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
this is a standalone PC.

chrism01 I know through useradd command we can create a user. But I was trying to create a user through editing /etc/passwd file.
 
Old 02-03-2012, 12:18 AM   #5
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
John VV, I also know through System /Administration /add user we can create a user.
 
Old 02-03-2012, 12:24 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
What could be the problem?
seeing as you did not use the normal tools SE is blocking the login because there is NO context

this is for your protection

SE will auto BLOCK a login to a not secured home folder
this is SOP


SELinux checks for the users SE context BEFORE the login can continue

Last edited by John VV; 02-03-2012 at 02:52 AM.
 
Old 02-03-2012, 12:32 AM   #7
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
Can we leave the password field blank when creating a new user?
 
Old 02-03-2012, 02:51 AM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,627

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
Can we leave the password field blank when creating a new user?
NO
linux is not Microsoft

you have to have a user name AND a password

and if the password is weak RHEL will complain about it
well almost every linux distro will
 
Old 02-03-2012, 02:58 AM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Rocky 9.2
Posts: 18,362

Rep: Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751Reputation: 2751
Actually, you should have an 'x' in the passwd field, so it knows the passwd is in /etc/shadow.
If you know the proper tools, why are you ignoring them???
 
Old 02-03-2012, 06:27 AM   #10
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by Nitin Chaudhary View Post
Can we leave the password field blank when creating a new user?
You will have to add a "*" at the place of password

go through these links

http://floppix.ccai.com/adduser.html
http://www.linuxquestions.org/questi...w-file-660564/
only thing to be noted is run this command after you copy everything from /etc/skel to home directory and give appropriate permissions

Code:
#pwconv
this will regenrate /etc/shadow file


Quote:
Originally Posted by John VV View Post
NO
linux is not Microsoft

you have to have a user name AND a password

and if the password is weak RHEL will complain about it
well almost every linux distro will
How can someone put password in /etc/passwd file?

Nitin is asking whether he can leave the space blank where a "x" is present in /etc/passwd

and even though RHEL will complain but it will accept the password on the contrary

Last edited by deep27ak; 02-03-2012 at 06:48 AM.
 
Old 02-03-2012, 06:28 AM   #11
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by chrism01 View Post
If you know the proper tools, why are you ignoring them???
Is there any harm if anyone wants to learn anything new?
 
Old 02-06-2012, 05:24 PM   #12
Nitin Chaudhary
LQ Newbie
 
Registered: Feb 2012
Location: India
Distribution: RHEL 5, Ubuntu 11.10
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thank You guys. Thanks a lot. I got my all the answers. Now, I'm marking my thread as solved.
 
  


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
[SOLVED] user login problem Tux Rules Linux - Software 4 09-07-2010 05:02 AM
user login problem p03p Linux - Newbie 2 03-04-2009 09:19 AM
new user login problem in X rengo.Java Linux - General 4 12-14-2007 05:42 AM
Problem on login as user satimis Linux - Distributions 2 03-29-2007 04:01 AM
telnet problem (not able to login as any user) anamika123 Linux - General 1 04-17-2004 03:08 AM

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

All times are GMT -5. The time now is 03:51 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
Open Source Consulting | Domain Registration