• 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 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. “yum clean all” not clearing yum repository cache in CentOS/RHEL/OEL
  2. Search XML Attributes PowerShell XPath
  3. Understanding /etc/xinetd.conf file in Linux
  4. How to Access VNC Server Through A Web Browser in Linux
  5. Basic “ls” Command examples in Linux
  6. Detect rootkits & malware on Linux Servers using rkhunter
  7. pmap Command Examples in Linux
  8. Understanding linux parted utility
  9. CentOS / RHEL 6,7 : How to use yum history to roll back a yum update
  10. fgrep Command Examples in Linux

You May Also Like

Primary Sidebar

Recent Posts

  • JavaFX ComboBox: Set a value to the combo box
  • Nginx load balancing
  • nginx 504 gateway time-out
  • Images preview with ngx_http_image_filter_module

© 2022 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright