• 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. addr2line Command Examples in Linux
  2. chkconfig Command Examples in Linux
  3. Understanding Device Persistence and Oracle ASMLib
  4. ‘nestat -s’ showing a large number for “packet reassembles failed” errors in CentOS/RHEL
  5. a2enmod: command not found
  6. How to change the interface name in CentOS/RHEL 8 using prefixdevname
  7. How to uninstall lammps package from Ubuntu
  8. CentOS / RHEL : How to install a specific version of rpm package using YUM
  9. How systemd-tmpfiles cleans up /tmp/ or /var/tmp (replacement of tmpwatch) in CentOS / RHEL 7
  10. Linux interview questions – Special permissions (SUID, SGID and sticky bit)

You May Also Like

Primary Sidebar

Recent Posts

  • fprintd-delete Command Examples in Linux
  • fprintd-delete: command not found
  • foreman: command not found
  • foreman Command Examples in Linux

© 2023 · The Geek Diary

  • Archives
  • Contact Us
  • Copyright