• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer navigation

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • VCS
  • Interview Questions
  • Database
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to Delete unnecessary Entry in /etc/shadow

by admin

Question: How to remove all the unnecessary user entries in /etc/shadow file.

1. Create a backup copy of /etc/shadow file.

# cp -p /etc/shadow /etc/shadow.backup

2. Ensure the user is not existing anymore in /etc/password file.

# cat /etc/passwd | grep [userid]

3. Edit the /etc/shadow file, look for the line and remove the unnecessary user entry.

# vi /etc/shadow

4. Ensure the user is not existing anymore in /etc/shadow file.

# cat /etc/shadow | grep [userid]
Note: The steps above should only be used when all other efforts have failed to remove the user.

Filed Under: Linux

Some more articles you might also be interested in …

  1. How to Compress and Extract Files and Directories in Linux Using gzip and bzip2
  2. lsmod: command not found
  3. a2disconf Command Examples in Linux
  4. “docker image” Command Examples
  5. maza Command Examples
  6. gox Command Examples
  7. setserial Command Examples in Linux
  8. How to find docker storage device and its size (device mapper storage driver)
  9. Linux “rm” Command Examples
  10. chown: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • Vanilla OS 2 Released: A New Era for Linux Enthusiasts
  • mk Command Examples
  • mixxx Command Examples
  • mix Command Examples

© 2025 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright