• 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

faillock Command Examples in Linux

by Deepika

“faillock” is a command-line tool in Linux-based systems that allows users to display and modify the authentication failure record files, also known as the “faillog” file. The faillog file keeps track of the number of failed login attempts for each user on the system, and is used as part of the authentication process to prevent brute-force attacks.

The “faillock” command can be used to display the contents of the faillog file, including the username, the number of failed login attempts, and the date of the last failed attempt. It can also be used to lock or unlock a user account, based on the number of failed login attempts. For example, if a user has exceeded a certain number of failed login attempts, the “faillock” command can be used to lock their account, preventing them from logging in until an administrator unlocks it.

Additionally, using the faillock command with the appropriate options, an administrator can also clear the faillog file, or set the maximum number of failed login attempts before an account is locked.

faillock Command Examples

1. List login failures of all users:

# sudo faillock

2. List login failures of the specified user:

# sudo faillock --user user

3. Reset the failure records of the specified user:

# sudo faillock --user user --reset

Filed Under: Linux

Some more articles you might also be interested in …

  1. “git replace” Command Examples
  2. exiv2: Image metadata manipulation tool
  3. dvc destroy: Remove all DVC files and directories from a DVC project
  4. mkfs.btrfs Command Examples in Linux
  5. pvcreate error : Can’t open /dev/sdx exclusively. Mounted filesystem?
  6. codespell: Spellchecker for source code
  7. rofi Command Examples in Linux
  8. chacl Command Examples in Linux
  9. certbot: command not found
  10. uname: command not found

You May Also Like

Primary Sidebar

Recent Posts

  • glab Command Examples
  • “glab repo” Command Examples
  • “glab release” Command Examples
  • “glab pipeline” Command Examples

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright