I'm running RHEL on HP server. This server allows to login to reset of the LAN from the Internet. How do I find out failed login records under Linux operating systems?
You need to use the faillog command to see the all failed login attempts. Linux records failed login into a special database at /var/log/faillog. To see contents of the failure log database at /var/log/faillog use faillog command. The same command can be used for
- Set the failure counters.
- Set or configure the limits.
- Display failed login information.
More About /var/log/faillog File
The /var/log/faillog maintains a count of login failures and the limits for each account. The file is binary format with the following the structure of the file:
struct faillog {
short fail_cnt;
short fail_max;
char fail_line[12];
time_t fail_time;
long fail_locktime;
};
You cannot view the structure using the cat command:
# cat /var/log/faillog
So you need to use the faillog command to display this binary file records.
faillog Command Examples
You must login as root to run the following command. You need to configure failed login as described in our previous tutorial. To display failed login attempts for user tom, enter:# faillog -u usernameHere
# faillog -u tomTo display failed login attempts for all users, enter:
# faillog -aTo display faillog records more recent than 5 days, enter:
# faillog -t 5 -u tom - 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop











{ 1 comment… read it below or add one }
Hi Vivek,
Your articles are quite precise and good. Often Google lands me to your page :).
I appreciate you for devoting your time and energy crafting them.
Cheers!