🐧
Linux
  • syllabus
  • unit 1-Introduction
    • Unit I: Introduction to Linux
    • 2. Advantages of Linux over other operating systems
    • 3.File systems
    • 4.Culture of free software
  • unit 2-Basics of Linux
    • 1.Commands
    • 2.shell
    • 3.Text Editors
    • 4.The file system of Linux
    • 5.Directories and their special purpose
    • 6.permission
  • unit 3-Installation
    • 1. Partitioning
    • 2. Installation of Linux
    • 3. Troubleshooting of installation
  • unit 4-System Administration
    • 1.Root login
    • 2.Superuser
    • 3.Configuration of hardware with kudzu
    • 4. Checking System Space:
    • 5. Monitoring System Performance:
    • 6. Working with a File System:
    • 7.Configuring modules
    • 8.jail shell
    • 9.awk
    • 10.sed
  • unit 5-User Management
    • 1.Creating user accounts
    • 2.Setting user defaults
    • 3.Providing support to users
    • 4.Modifying accounts
    • 5.Deleting user accounts
    • 6.Checking disk quotas
    • 7.Sending mail to all users
  • unit 6-Security and System Handling
    • 1.Understanding shell scripts
    • 2.System startup and shutdown
    • 3.Scheduling system tasks
    • 4.Backing up and restoring
    • 5.Password protection
    • 6.File security
  • unit 7-Setting up a Web Server
    • 1.Introduction to a web server
    • 2.Starting the Apache webserver
    • 3.Configuring the Apache webserver
    • 4.Monitoring server activities
  • unit 8-Setting up DHCP and NIS
    • 1.Introduction to DHCP
    • 2.Setting up DHCP Server
    • 3.Setting up DHCP Client
    • 4.Understand NIS
  • unit 9-Setting up a Database Server
    • 1.Configuring database server
    • 2.Checking the status
    • 3.Working with database
  • unit 10-Setting up DNS
    • 1.Introduction to DNS
    • 2.Setting up DNS and configuration
    • 3.Querying DNS
  • unit 11-ISP Simulation
    • 1.Integration of servers
    • 2.DNS, Web, Email, etc
  • fullform
  • Assignment
  • Practicals
    • 1.Linux utilities
    • 2.OS installation project work
    • 3.User management using a terminal
    • 4.Security level access control list
    • 1.Network setting
    • 2.Server configuration of DHCP, DNS, Database server
    • 3.Demonstration of the web, mail, file server
  • imp questions
    • short-notes
    • unit 1
    • unit 2
    • unit 3
    • unit 4
    • unit 5
    • unit 6
    • unit 7
    • unit 8
    • unit 9
    • unit 10
    • unit 11
    • unit ii
  • services
    • create_service
  • Viva+Practical
    • VIVA questions
    • Practical questions
Powered by GitBook
On this page

Was this helpful?

  1. unit 5-User Management

5.Deleting user accounts

Deleting user accounts in a Linux system involves removing the user's account and associated files. To delete a user account, follow these steps:

Note: You typically need superuser privileges (root or sudo) to delete user accounts.

  1. Backup Data (Optional):

    • Before deleting a user account, it's a good practice to back up any important data owned by that user. This ensures that valuable files are not lost during the deletion process.

  2. Log in as Superuser:

    • Open a terminal and log in as the superuser (root) or use the sudo command to run administrative tasks.

  3. Delete User Account:

    • Use the userdel command to delete the user account. To delete only the user account without removing the user's home directory and mail spool (if any), use the following command:

      sudo userdel username
    • Replace username with the name of the user account you want to delete.

  4. Delete User Account with Home Directory:

    • If you want to delete the user account along with their home directory and mail spool (if present), use the -r option with userdel:

      sudo userdel -r username
    • The -r option recursively removes the user's home directory and its contents.

  5. Remove Associated Files (Optional):

    • After deleting the user account, you can manually check for any residual files owned by the user in system directories (e.g., /var/mail) and remove them if necessary.

  6. Update User List (Optional):

    • The user account information is typically stored in the /etc/passwd file. You can manually remove the user's line from this file if it wasn't removed automatically by the userdel command:

      sudo nano /etc/passwd
    • Locate the line that corresponds to the deleted user and delete it. Save the file and exit the text editor.

  7. Check for Associated Groups (Optional):

    • If the deleted user was a member of any groups that are no longer needed, you can use the gpasswd or groupdel command to remove them from those groups.

      sudo gpasswd -d username groupname

      Replace username with the username and groupname with the group name.

  8. Verify Deletion:

    • You can use the id command or getent passwd to verify that the user account has been successfully deleted:

      id username

      If the account has been deleted, you should receive an error message indicating that the user does not exist.

  9. Reassign Files (Optional):

    • If any files or directories previously owned by the deleted user need new ownership, use the chown command to assign them to another user or group:

      sudo chown new_owner:new_group file_or_directory

      Replace new_owner and new_group with the appropriate user and group names.

Previous4.Modifying accountsNext6.Checking disk quotas

Last updated 1 year ago

Was this helpful?