LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 10-18-2010, 01:40 AM   #1
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Rep: Reputation: 15
Exclamation How to add user in linux


Hello Friends,

I want to add a user in a group, while doing so getting user doesn't exist. and when added this user getting user already exist message.

For reference find the below output.

[root@indls00x ~]# usermod -G Ind-Linux-QA mathurr
usermod: user mathurr does not exist
[root@indls00x ~]# /usr/bin/getent passwd | grep mathurr
mathurr:x:12271:12271:Mathur, Rajat X:/home/mathurr:/bin/bash
[root@indls00x ~]#

Thanks-
Shankar
 
Old 10-18-2010, 01:49 AM   #2
T0sh1r0
Member
 
Registered: Oct 2010
Posts: 51
Blog Entries: 1

Rep: Reputation: Disabled
Not sure it will work better, but have you tried with gpasswd?

gpasswd -a mathurr Ind-Linux-QA

Hope this helps you. On the other hand, I can not see why it does not work. I am curious if someone finds why.
 
Old 10-18-2010, 02:07 AM   #3
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Original Poster
Rep: Reputation: 15
[root@indls00x ~]# gpasswd -a mathurr Ind-Linux-QA
User doesn't exist.

This user is not in /etc/passwd file, when we add this user locally, getting user already exist.
 
Old 10-18-2010, 02:23 AM   #4
T0sh1r0
Member
 
Registered: Oct 2010
Posts: 51
Blog Entries: 1

Rep: Reputation: Disabled
Really strange.

Do you have something in /etc/shadow for that user?
Have you deleted this user? Maybe something went wrong, for instance the user could be connected when his account was deleted...
 
Old 10-18-2010, 02:48 AM   #5
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Original Poster
Rep: Reputation: 15
[root@indls00x ~]# gpasswd -a mathurr Ind-Linux-QA
gpasswd: unknown user mathurr

[root@indls0039 ~]# cat /etc/shadow | grep mathurr
[root@indls0039 ~]# ls -l /home
total 64
drwx------ 3 mathurr mathurr 4096 Oct 5 11:15 mathurr
...
 
Old 10-18-2010, 04:24 AM   #6
bulls_i3
LQ Newbie
 
Registered: Jan 2010
Posts: 20

Rep: Reputation: 2
Why don't you try

useradd mathurr
usermod -G Ind-Linux-QA mathurr

?

It won't delete any of the user's files (if he has any).
 
Old 10-18-2010, 05:00 AM   #7
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Original Poster
Rep: Reputation: 15
I have tried earlier and was in that case user is created locally in /etc/passwd file and geeting error at the time of login( user conflict)
 
Old 10-19-2010, 01:14 AM   #8
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Original Poster
Rep: Reputation: 15
I mean, when created user locally(useradd mathurr), getting conflicting user.

and when usermod -G Ind-Linux-QA mathurr, getting user does not exist, but getent passwd give the user details.

[root@indls00x ~]# usermod -G Ind-Linux-QA mathurr
usermod: user mathurr does not exist
[root@indls00x ~]# /usr/bin/getent passwd | grep mathurr
mathurr:x:12271:12271:Mathur, Rajat X:/home/mathurr:/bin/bash
[root@indls00x ~]#

Help is appreciated!!
 
Old 10-19-2010, 03:14 AM   #9
T0sh1r0
Member
 
Registered: Oct 2010
Posts: 51
Blog Entries: 1

Rep: Reputation: Disabled
If /usr/bin/getent passwd | grep mathurr returns a result, I guess there is something in /etc/passwd. This could be the reason of your problem.
What's the result of grep mathurr /etc/passwd ?
 
Old 10-19-2010, 03:17 AM   #10
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Original Poster
Rep: Reputation: 15
Nothing, even I have checked manually.
 
0 members found this post helpful.
Old 10-19-2010, 03:30 AM   #11
T0sh1r0
Member
 
Registered: Oct 2010
Posts: 51
Blog Entries: 1

Rep: Reputation: Disabled
I am very sorry but I do not have other ideas to help you... :-(
 
Old 10-19-2010, 05:36 AM   #12
JATA01
Member
 
Registered: Nov 2007
Posts: 207

Original Poster
Rep: Reputation: 15
I just got, it's a centrify user.


Now can we add users in a locally created group in "/etc/group"?
I am not sure, but can it be work?
 
0 members found this post helpful.
  


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
How to list user in Linux box, add an user to a group! steady_lfcfan Linux - Newbie 12 01-27-2013 01:14 PM
linux user add delmoras Linux - Newbie 4 12-22-2008 05:11 PM
Do you know how to add an ftp user in Linux? amtoj Linux - Newbie 5 08-29-2008 06:29 AM
How to add a user in linux to be strong as root juanb Linux - Security 4 09-22-2004 03:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

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