LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-30-2015, 03:22 AM   #1
jmenengo
LQ Newbie
 
Registered: Feb 2015
Posts: 3

Rep: Reputation: Disabled
rhel7. Unlocking User Accounts After Password Failures


With redhat 7, the command for unlocking an user is
faillock --user <username> --reset
But I don't find how to know if a user is locked.
I can find in "/var/log/seucre"

grep user1 /var/log/secure
Apr 30 10:10:45 maquina1 sshd[12321]: pam_faillock(sshd:auth): Consecutive login failures for user user1 account temporarily locked

But I ask myself if there is a command or any way to see this easier.

Thanks
 
Old 04-30-2015, 08:49 PM   #2
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Try this link from Red Hat:

https://access.redhat.com/documentat...er-unlock.html

This second link may work but you should call Red Hat first and make sure if you should use this.
http://www.redhat.com/en/about/contact

http://sharadchhetri.com/2013/12/13/...ount-in-linux/
 
Old 05-01-2015, 02:27 AM   #3
jmenengo
LQ Newbie
 
Registered: Feb 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
thanks for the reply, but I think that is only valid for redhat 6.
The problem is with redhat7 or CentOs7.
There are a many changes in this version and these commands don't work in rhel7.
 
Old 05-01-2015, 06:43 AM   #4
sgrlscz
Member
 
Registered: Aug 2008
Posts: 123

Rep: Reputation: 84
The faillock command without any arguments should list any locked accounts.
 
1 members found this post helpful.
Old 05-01-2015, 09:33 PM   #5
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
Quote:
Originally Posted by jmenengo View Post
thanks for the reply, but I think that is only valid for redhat 6.
The problem is with redhat7 or CentOs7.
There are a many changes in this version and these commands don't work in rhel7.
Try reading through the documentation for RHEL 7 or give Red Hat a call.
https://access.redhat.com/documentat...prise_Linux/7/
 
Old 05-04-2015, 05:51 AM   #6
jmenengo
LQ Newbie
 
Registered: Feb 2015
Posts: 3

Original Poster
Rep: Reputation: Disabled
The command
faillock --user nameuser
(without --reset)
displays the failed authentication attempts. This information comes
ls -l /var/run/faillock

cat /var/run/faillock/username

The number of attempts is defined in

/etc/pam.d/system-auth
/etc/pam.d/password-auth
auth required pam_faillock.so preauth silent audit deny=3

in this case "deny=3", the user is locked with 3 attempsts in this file /var/run/faillock/username
I think this is so ...
 
Old 05-04-2015, 08:20 PM   #7
Ztcoracat
LQ Guru
 
Registered: Dec 2011
Distribution: Slackware, MX 18
Posts: 9,484
Blog Entries: 15

Rep: Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176Reputation: 1176
An account is unlocked using the user-unlock command.

Have you tried it?

https://access.redhat.com/documentat...er-unlock.html

http://www.linuxnix.com/2012/01/unlo...unt-linux.html
http://www.cyberciti.biz/faq/unlocki...ount-in-linux/
http://unixhelp.ed.ac.uk/CGI/man-cgi?passwd
 
Old 05-12-2015, 11:52 AM   #8
ron7000
Member
 
Registered: Nov 2007
Location: CT
Posts: 248

Rep: Reputation: 26
you would think with what you have to pay for rhel to do something simple like this... would be simple.

i don't know how we ever survived before we locked out user accounts after 3 failed attempts

while your at it, to be safe better bump up minimum password length to 20 characters and have it expire every 30 days.

Last edited by ron7000; 05-12-2015 at 11:53 AM.
 
Old 10-19-2021, 10:53 AM   #9
dyoung02
LQ Newbie
 
Registered: May 2015
Posts: 6

Rep: Reputation: Disabled
rhel7. Unlocking User Accounts After Password Failures

You can use the passwd -S <username> command and look to see if LK appears next to the username.
 
Old 10-19-2021, 10:57 AM   #10
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,617

Rep: Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963Reputation: 7963
Quote:
Originally Posted by dyoung02 View Post
You can use the passwd -S <username> command and look to see if LK appears next to the username.
Indeed; but this thread had been closed for six years already.
 
Old 10-19-2021, 11:20 AM   #11
dyoung02
LQ Newbie
 
Registered: May 2015
Posts: 6

Rep: Reputation: Disabled
Quote:
Originally Posted by TB0ne View Post
Indeed; but this thread had been closed for six years already.
True, but the same way I came across it 6 years later for the faillock command I didn't see a direct answer to the original question so I figured I'd put it out there in case anyone else comes across this page looking for a direct answer to the original question.
 
Old 11-11-2021, 04:26 AM   #12
JockVSJock
Senior Member
 
Registered: Jan 2004
Posts: 1,420
Blog Entries: 4

Rep: Reputation: 164Reputation: 164
Quote:
Originally Posted by dyoung02 View Post
True, but the same way I came across it 6 years later for the faillock command I didn't see a direct answer to the original question so I figured I'd put it out there in case anyone else comes across this page looking for a direct answer to the original question.
I just learned something that I didn't know, from this old thread.

thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Unable to install RHEL7 KVM onto RHEL7 desktop redhatprat Red Hat 10 02-18-2015 03:44 AM
Unlocking an ancient password sinbad13 Linux - Newbie 6 06-05-2013 09:48 AM
Creating user accounts from a csv file, force to change password and create alias rojasm Linux - Newbie 13 04-02-2013 10:19 PM
Trying to lock user accounts after too many login failures. larold Linux - Security 1 06-08-2010 02:39 PM
How to set password when creating user accounts correro Linux - Newbie 3 02-08-2007 02:32 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 10:54 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration