delete user

hello,

Aside from userdel -r "username', are there any things needed to check before deleting a user? I wanted to cleanup user accounts and Im just worried if there are scripts or tasks created or owned by them that might be affected once I deleted the account. I normally login to their account and execute crontab -l to check scripts owned by them Any other methods or means?

Pls advise.

You can try

find [list of base directories normal users can write to] -exec ls -l {} \;

Where the list might be: /home /users /data
If these are privileged users then you have a whole new problem.

Only way to be safe is:

find / -user <username>

This will take a long time as it scans the whole system, but, will return on anything that's owned by the user.

Remember, it is near impossible to remove accounts that may be woven into configuration also, ie. an account could be doing things such as:

Cron - (sudo -u <user> crontab -l)
Remote connections (shared keys)
Running a daemon - (ps -ef |grep <user>)
Doing loads or something else with a daemon (maybe lsof)
etc.

And this could become very painful very fast.