To remove an unneeded user account use the ``. '' command, which must be typed as ``root''.
Removing User Accounts. On occasion, you may wish to remove a user's access from your server altogether. If you are a Red Hat user, the easiest way to remove an unneeded user account is with the ``. '' command, which must be typed as ``root''. The above command will remove the entry matching the username `` baduser from the ``. '', file, and, if you're using the Shadow password format (which you should be; see Section 6.6 for details), the ``. ''. Note: Note: The ``/etc/group'' is not modified, to avoid removing a group that other user(s) may also belong to. Deleting user account in Linux is as a task to remove user login credentials from system configuration files such as /etc/passwd, /etc/shadow and files which are owned by that particular user from the Linux server. Here we are going to see on how to delete a user and precautions to be taken when deleting users. userdel-r username. -r stands for remove home directory as well. The disadvantage of above two commands are that they will not delete user files which are scattered across the machine such as his personal files, his mail spool etc. Should you wish to remove the user's home directory as well, add the ``. '' option to the ``userdel'' command. For example: I recommend not removing an account right away, but first simply disable it, especially if you are working with a corporate server with lots of users. The above command will remove the entry matching the username `` baduser from the ``. '', file, and, if you're using the Shadow password format (which you should be; see Section 6.6 for details), the ``. ''. Note: Note: The ``/etc/group'' is not modified, to avoid removing a group that other user(s) may also belong to. Not only can you manage users from the command line, but Red Hat Linux also provides a couple of utilities for managing groups. To create a new group you can use the. command: You can then add a user to the group with the. command: To delete the group use the. command: All group commands modify the. file.  deluser –force username. Example4: Delete user account along with his home directory. deluser –remove-home username. Example5: Delete user account along with his home directory and his personal files which are located in different locations which you are not aware. userdel-r username. -r stands for remove home directory as well. The disadvantage of above two commands are that they will not delete user files which are scattered across the machine such as his personal files, his mail spool etc. Example2: Deleting user account and his home directory from a Linux machine. userdel-r username. -r stands for remove home directory as well. The disadvantage of above two commands are that they will not delete user files which are scattered across the machine such as his personal files, his mail spool etc. Delete User in Red hat and CentOS. (1) To delete the user ,use below given command. Note: The above command will not remove user’s home directory and mail spool. (2) Delete user with its home directory and mail spool. create and delete user examples in Red Hat and CentOS. In this tutorial we will learn about creating and deleting the user in Red Hat and CentOS. In this post we will explore the useradd and userdel commands. Basic command to create user. 6.5. On occasion, you may wish to remove a user's access from your server altogether. If you are a Red Hat user, the easiest way to remove an unneeded user account is with the ``. '' command, which must be typed as ``root''. The above command will remove the entry matching the username `` baduser from the ``. '', file, and, if you're using the Shadow password format (which you should be; see Section 6.6 for details), the ``. ''. Note: Note: The ``/etc/group'' is not modified, to avoid removing a group that other user(s) may also belong to. userdel Example. To remove the user vivek account from the local system / server / workstation, enter: # userdel vivek. To remove the user's home directory pass the-r option to userdel, enter: # userdel-r vivek. The above command will remove all files along with the home directory itself and the user's mail spool. Please note that files located in other file systems will have to be searched for and deleted manually.
http://www.tldp.org/LDP/lame/LAME/linux-admin-made-easy/removing-user-accounts.html http://www.linuxnix.com/delete-user-account-linux/ http://www.tldp.org/LDP/lame/LAME/linux-admin-made-easy/removing-user-accounts.html http://www.informit.com/library/content.aspx?b=red_hat_linux7&seqNum=208 http://www.linuxnix.com/delete-user-account-linux/ http://www.linuxnix.com/delete-user-account-linux/ http://sharadchhetri.com/2013/07/17/create-and-delete-user-in-red-hat-and-centos/ http://www.tldp.org/LDP/lame/LAME/linux-admin-made-easy/removing-user-accounts.html http://www.cyberciti.biz/faq/linux-remove-user-command/
how to delete user in redhat linux