• 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

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. vnstati: command not found
  2. viewnior Command Examples in Linux
  3. pdftoppm: command not found
  4. How to Capture More Logs in /var/log/dmesg for CentOS/RHEL
  5. Beginners Guide to Tuning Profiles in CentOS/RHEL
  6. Auditd Messages Are Filling Up /var/log/messages
  7. colorls: A Ruby gem that beautifies the terminal’s ls command, with color and font-awesome icons
  8. pacman –database Command Examples in Arch Linux
  9. atrm Command Examples in Linux
  10. How to Set CPU Affinity for SYSTEMD Process in CentOS/RHEL 7

You May Also Like

Primary Sidebar

Recent Posts

  • ctags: Generates an index (or tag) file of language objects found in source files for many popular programming languages
  • csvtool: Utility to filter and extract data from CSV formatted sources
  • csvstat: Print descriptive statistics for all columns in a CSV file
  • csvsql: Generate SQL statements for a CSV file or execute those statements directly on a database

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright