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

The Geek Diary

  • OS
    • Linux
    • CentOS/RHEL
    • Solaris
    • Oracle Linux
    • VCS
  • Interview Questions
  • Database
    • oracle
    • oracle 12c
    • ASM
    • mysql
    • MariaDB
  • DevOps
    • Docker
    • Shell Scripting
  • Big Data
    • Hadoop
    • Cloudera
    • Hortonworks HDP

How to remove unwanted entries in /etc/shadow file

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: CentOS/RHEL, Linux

Some more articles you might also be interested in …

  1. “device-mapper: resume ioctl failed: Invalid argument” – error on running lvcreate/lvresize/lvextend
  2. faillock Command Examples in Linux
  3. Tutorial on Linux Clustering (High Availability)
  4. dm-tool: command not found
  5. Beginners Guide to Tuning Profiles in CentOS/RHEL
  6. grub-bios-setup: command not found
  7. How to analyze basic system performance using – vmstat, sar, iostat and mpstat
  8. pluma Command Examples in Linux
  9. abbr Command Examples in fish-shell
  10. gradle: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • qm Command Examples in Linux
  • qm wait Command Examples in Linux
  • qm start Command Examples in Linux
  • qm snapshot Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright