System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

RHES3U4 userdel erro could not remove user

 
SOLVED
Go to solution
Highlighted
Super Advisor

RHES3U4 userdel erro could not remove user

Hi

My system OS is Redhat ES 3 update 4.
I could not remove a user, details are as follows:

#id j4
uid=10004(j4) gid=100(users) groups=100(users)

#userdel -rf j4
userdel: error deleting password entry
userdel: error deleting shadow password entry
userdel: error removing directory /home/j4
(the same userdel -r or userdel -f)

#id j4
uid=10004(j4) gid=100(users) groups=100(users)

Through check from VNC remote desktop - system setting - users and groups, j4 not in the list.

# ps -ef | grep j4
root 30345 29617 0 16:50 pts/49 00:00:00 grep j4
and
# who
# w
user j4 not in the system

# useradd j4
useradd: user j4 exists
but i could add j4 user through Linux GUI users and groups, I add a user j4 userid:500

# id j4
[root@srs119 home]# id j4
uid=500(j4) gid=100(users) groups=100(users)

but
after I did: #userdel -rf j4

# id j4
uid=10004(j4) gid=100(users) groups=100(users)

What's going on? How to remove the user j4?
Any answers will be very appreciate.

-Gary

5 REPLIES 5
Highlighted
Super Advisor

Re: RHES3U4 userdel erro could not remove user

BTW,

as a root user did below error:

# su j4
su: incorrect password

root user do the command su need passowd? I don't think so. And why incorrect password.


Highlighted
Honored Contributor
Solution

Re: RHES3U4 userdel erro could not remove user

Are you using a user database, for example, NIS or LDAP?

Is the user listed in local files?

grep j4 /etc/passwd
grep j4 /etc/shadow
grep j4 /etc/group

Can you post the content of:

/etc/nsswitch.conf
/etc/pam.d/system-auth
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Highlighted
Super Advisor

Re: RHES3U4 userdel erro could not remove user

Hi Ivan

Thank you very much for your fast reply.
I have no idea whether we using user database, as this server's user adding task done by last admin.

# grep j4 /etc/passwd
# grep j4 /etc/shadow
# grep j4 /etc/group
after donen above checks, there is no j4 entry in those three files.

# cat /etc/nsswitch.conf
#
# /etc/nsswitch.conf
#
# An example Name Service Switch config file. This file should be
# sorted with the most-used services at the beginning.
#
# The entry '[NOTFOUND=return]' means that the search for an
# entry should stop if the search in the previous entry turned
# up nothing. Note that if the search failed due to some other reason
# (like no NIS server responding) then the search continues with the
# next entry.
#
# Legal entries are:
#
# nisplus or nis+ Use NIS+ (NIS version 3)
# nis or yp Use NIS (NIS version 2), also called YP
# dns Use DNS (Domain Name Service)
# files Use the local files
# db Use the local database (.db) files
# compat Use NIS on compat mode
# hesiod Use Hesiod for user lookups
# [NOTFOUND=return] Stop searching if not found so far
#

# To use db, put the "db" in front of "files" for entries you want to be
# looked up first in the databases
#
# Example:
#passwd: db files nisplus nis
#shadow: db files nisplus nis
#group: db files nisplus nis

passwd: files ldap
shadow: files ldap
group: files ldap

#hosts: db files nisplus nis dns
hosts: files dns

# Example - obey only what nisplus tells us...
#services: nisplus [NOTFOUND=return] files
#networks: nisplus [NOTFOUND=return] files
#protocols: nisplus [NOTFOUND=return] files
#rpc: nisplus [NOTFOUND=return] files
#ethers: nisplus [NOTFOUND=return] files
#netmasks: nisplus [NOTFOUND=return] files

bootparams: nisplus [NOTFOUND=return] files

ethers: files
netmasks: files
networks: files
protocols: files ldap
rpc: files
services: files ldap

netgroup: files ldap

publickey: nisplus

automount: files ldap
aliases: files nisplus

# cat etc/pam.d/system-auth
cat: etc/pam.d/system-auth: No such file or directory
Highlighted
Honored Contributor

Re: RHES3U4 userdel erro could not remove user

Based on the output of your commands, 100% sure that the user is an LDAP user. You must remove the user from the LDAP database.

You can identify your LDAP server by checking /etc/ldap.conf.

There is a excelent tool to managet LDAP directories called ldapadmin.exe.

If you don't know about LDAP, hurry!
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Highlighted
Super Advisor

Re: RHES3U4 userdel erro could not remove user

Thanks Ivan.
Thank you very much for your kindly help.
I will check LDAP database soon.
Have a great day

-Gary