User account locking questions
userdel man page says:
Quote:
When I want to stop an user from logging into a system, but keep his files (e.g., to be analysed or just kept), is one of these best or bad? - just locking the account, or - remove his account but keeping his files, or - backup his files and removing the user completely What choices would have the same steps across most flavors of systems? |
Locking the account should prevent login. Off hand, I think you could also set the login terminal to /bin/false and accomplish the same thing. A simple option would be, as root, to change their password to something that they would have an extremely hard time guessing.
|
@ Reply
Hi dedec0,
It is always a good practice to remove the user account when you know that this account will not be used in future. However, if you have scenario wherein there are chances of that user coming back then it is better to keep his account disabled for that time frame. Let me put it in simple way. Disable the user account using usermod -L for a month. If that user does not comes back then delete the user account. Ofcourse you have to maintain a sheet which will keep a record when you have disabled the user account and when you should delete it. It is always a good idea to retain the data belongs to the user you will going to delete for audit purpose. You can find out the files that were owned/created by the user using find / -user <username> command. Procedure will look like as follows: 1. Disable the user account and keep it disabled for a month. 2. If your comes back within a month re-enable the account, reset the password and give credential to the user. 3. If user does not comes back then find out all the files owned/created by him using find command. Make a copy of it under some backup directory and delete the user account. |
Cleaning up when a user leaves.
Quote:
Eliminate shell login ability Code:
# passwd -l joe Code:
# mv /home/joe /home/joe.gone Code:
# crontab -u joe -l Code:
# visudo Code:
# ps aux | grep '^joe' Code:
# find / -user joe > joe-files |
All times are GMT -5. The time now is 06:37 AM. |