Click to See Complete Forum and Search --> : How do I remove a user?


kuber
11-13-2000, 09:01 PM
?

dawnsk1
11-13-2000, 09:07 PM
remove the line in the /etc/passwd file that contains that users id. this will prevent any future logins :-)

if you want to remove the user completely, rm -rf the /home/username directory

-dawn

SlCKB0Y
11-13-2000, 11:38 PM
I tend to think the command

root@localhost:~$ userdel usernametodelete

is a lot more elegant.

try "man userdel"

Sokertes
11-14-2000, 01:18 AM
Why not use linuxconf to remove the user, password, and the whole damn profile and registries?

Just a thought

Sokertes

SlCKB0Y
11-14-2000, 01:28 AM
Originally posted by Sokertes:
Why not use linuxconf to remove the user, password, and the whole damn profile and registries?

Just a thought

Sokertes

userdel will do all that and i only suggested that over linuxconf because not all systems/distros have linuxconf or can even run it.

dawnsk1
11-14-2000, 09:41 PM
I'm not sure what you mean by more elegant?

I think it is better to have knowledge doing the things that the tools do for you so that you have a sound understanding of what is exactly happening when you use that tool.

-dawn

SlCKB0Y
11-14-2000, 09:51 PM
Originally posted by dawnsk1:
I'm not sure what you mean by more elegant?


I think it is better to have knowledge doing the things that the tools do for you so that you have a sound understanding of what is exactly happening when you use that tool.


-dawn


Think about it. If all your doing is removing their ability to log in and their home directory, you can leave behind other relics of their stay in your system.

If their username was specifically added to a entry in /etc/group, your method wont remove this. What if some file outside their home directory has been chowned by a now deleted user? Your way will leave crap everywhere.

Now I dont think deleting a user is a complex enough operation to warrant "having a sound understanding", but merely a mundane exercise that most people would like to have over and done with. Its not like we are doing something like using SWAT to set up Samba instead of editing smb.conf.

P.s do you have linuxconf?

Strike
11-15-2000, 01:25 AM
And, for added elegance (meaning a more complete solution for more situations, etc), I believe userdel can/will archive that users stuff for a certain amount of time in case you need to restore that user. If not, then there is some tool that does this somewhere, I'm 99% sure of that.

njcajun
11-15-2000, 09:14 AM
hmmm...

I guess I would probably do the userdel thing as noted above, and afterward run something like:


find / -user username -print 2>/dev/null;
find / -user root -group lamers -print 2>/dev/null


...or some variation of that to make sure there are no lingering files laying around.

------------------
...meanwhile, I remain...
...The RedHatted Stepchild...

cdburgess75
11-17-2000, 08:30 AM
to remove a user i use vips
go to the users lines with you arrow keys and hit dd
this will delete that line.
delete your user then type :wq
this closes and saves the vi editor