LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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-03-2012, 12:12 AM   #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-03-2012 at 12:14 AM.
 
Old 02-03-2012, 12:23 AM   #2
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
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-03-2012, 12:38 AM   #3
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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, 01: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, 01: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, 01:24 AM   #6
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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 03:52 AM.
 
Old 02-03-2012, 01: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, 03:51 AM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 16,825

Rep: Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408Reputation: 2408
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, 03:58 AM   #9
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,241

Rep: Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325Reputation: 2325
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, 07:27 AM   #10
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
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 07:48 AM.
 
Old 02-03-2012, 07:28 AM   #11
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: rhel 5x,6.0,6.2, centOS 5x,6.0,6.2
Posts: 1,194
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, 06: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


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


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