Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-18-2010, 01:40 AM
|
#1
|
Member
Registered: Nov 2007
Posts: 207
Rep:
|
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
|
|
|
10-18-2010, 01:49 AM
|
#2
|
Member
Registered: Oct 2010
Posts: 51
Rep: 
|
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.
|
|
|
10-18-2010, 02:07 AM
|
#3
|
Member
Registered: Nov 2007
Posts: 207
Original Poster
Rep:
|
[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.
|
|
|
10-18-2010, 02:23 AM
|
#4
|
Member
Registered: Oct 2010
Posts: 51
Rep: 
|
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...
|
|
|
10-18-2010, 02:48 AM
|
#5
|
Member
Registered: Nov 2007
Posts: 207
Original Poster
Rep:
|
[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
...
|
|
|
10-18-2010, 04:24 AM
|
#6
|
LQ Newbie
Registered: Jan 2010
Posts: 20
Rep:
|
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).
|
|
|
10-18-2010, 05:00 AM
|
#7
|
Member
Registered: Nov 2007
Posts: 207
Original Poster
Rep:
|
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)
|
|
|
10-19-2010, 01:14 AM
|
#8
|
Member
Registered: Nov 2007
Posts: 207
Original Poster
Rep:
|
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!!
|
|
|
10-19-2010, 03:14 AM
|
#9
|
Member
Registered: Oct 2010
Posts: 51
Rep: 
|
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 ?
|
|
|
10-19-2010, 03:17 AM
|
#10
|
Member
Registered: Nov 2007
Posts: 207
Original Poster
Rep:
|
Nothing, even I have checked manually.
|
|
0 members found this post helpful.
|
10-19-2010, 03:30 AM
|
#11
|
Member
Registered: Oct 2010
Posts: 51
Rep: 
|
I am very sorry but I do not have other ideas to help you... :-(
|
|
|
10-19-2010, 05:36 AM
|
#12
|
Member
Registered: Nov 2007
Posts: 207
Original Poster
Rep:
|
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.
|
All times are GMT -5. The time now is 08:44 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|