February 25, 2008
To check if a user exists in Linux, you can go:
1. You want to remove any files owned by that user, so use the following command:
find / -user username
2. Remove all files belonging to the Linux user.
3. Remove the relevant lines from /etc/passwd and /etc/groups
For example:
cat /etc/passwd | grep username
This is the line you would want to remove if you are deleting the user ‘username’: username:x:503:503::/home/username:/bin/bash
Note: In some Linux distributions you can use the command userdel, or deluser
Tags:
linux,
ssh,
system administration
Related posts
Filed under: Uncategorized by — aaron @ 5:31 pm
Leave a Reply