- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- User able login after 3 failed attempts
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2006 12:45 AM
тАО06-23-2006 12:45 AM
A user was able to login after 3 failed login attempts.
How can set the number of failed login attempts?
The systems are NON-trusted systems running 11.23 in a Service Guard environment?
I know that going to trusted system would be better, but for now, I just need to figure out how to fix this number of failed login attempts problem.
In the mean time, if someone is willing to provide step by step instructions, or point to a document that explains how to go to a trusted system in Service Guard environment, that would great also.
Thanks in advance for your help.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2006 12:52 AM
тАО06-23-2006 12:52 AM
Re: User able login after 3 failed attempts
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=597942
Regards,
Jaime.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2006 12:54 AM
тАО06-23-2006 12:54 AM
SolutionThere is no mechanism other than scripting to disable accounts on non-trusted systems after three failed login attempts.
Its kind of tricky, because trusted systems look for three consecutive failed logins.
strings /var/adm/btmp | awk '{print $1}' | sort -u > /tmp/checkfile
# You may need to use something other than $1, my HP-9000 servers at home are turned off to converve my bank account(Chasmal Yisrael eg electric company).
After you get check file.
while read -r username
do
badlog=$(strings /var/adm/btmp grep $username | wc -l)
if [ $badlog -ge 3 ] then
passwd -l $username
fi
done < /tmp/checkfile
rm -f /tmp/checkfile
You might want to insert some code to drop the offending user an email. Because this mechanism is unable to check consecutive bad logins like trusted, you must either improve it or I'd recommend setting the threashold higher.
Also, you will need to periodically empty the /var/adm/btmp (might be /var/adm/syslog/btmp) file otherwise eventually all users will disable themselves.
Trusted system is somewhat easier to manage.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2006 01:27 AM
тАО06-23-2006 01:27 AM
Re: User able login after 3 failed attempts
I may be able to use the script you provided, but would the script also disable the root account. If so, is there a line I can put in the script to exclude the root account?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2006 01:36 AM
тАО06-23-2006 01:36 AM
Re: User able login after 3 failed attempts
If you've trusted mode enabled:
logins -ox \
| awk -F: '($8 != "LK" && $1 != "root") { print $1 }' \
| while read logname; do
/usr/lbin/modprpw -m umaxlntr=3 "$logname"
done
modprdef -m umaxlntr=3
echo NUMBER_OF_LOGINS_ALLOWED=3 >> /etc/default/security
Discussion:
The commands above set the number of failed login attempts a user is allowed before
being disconnected from the system and having to re-initiate their login session when running in HP-UX Trusted Mode. Setting this number to a reasonably low value helps
discourage brute force password guessing attacks.
You can download the following Document,
CIS_HPUX_Benchmark_v1.3.1.pdf at the following url for more info.
http://www.cisecurity.org/bench_hpux.html
Darrel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2006 01:36 AM
тАО06-23-2006 01:36 AM
Re: User able login after 3 failed attempts
## added the grep -v root to exclude it from the data set.
strings /var/adm/btmp | awk '{print $1}' | sort -u | grep -v root >/tmp/checkfile
# You may need to use something other than $1, my HP-9000 servers at home are turned off to converve my bank account(Chasmal Yisrael eg electric company).
After you get check file.
while read -r username
do
badlog=$(strings /var/adm/btmp grep $username | wc -l)
if [ $badlog -ge 3 ] then
passwd -l $username
# could also add logic to exclude root here before the passwd -l command
fi
done < /tmp/checkfile
rm -f /tmp/checkfile
Note, my code requires some debug testing.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2006 03:25 AM
тАО06-23-2006 03:25 AM
Re: User able login after 3 failed attempts
I do a have a question regarding the script. As I am not a scripter, I a little hazed on exactely where to put this line;
strings /var/adm/btmp | awk '{print $1}' | sort -u | grep -v root >/tmp/checkfile
And
What should I put on this line;
# could also add logic to exclude root here before the passwd -l command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2006 03:55 AM
тАО06-23-2006 03:55 AM
Re: User able login after 3 failed attempts
An un-Trusted system cannot meet today's security standards including automatic lockout based on failed attemps as well as rules for ctreating new passwords. You need to convert to a Trusted syst5em. Be sure to change the entry in /etc/nsswitch.conf from passwd:compat to passwd:files before converting to Trusted.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-23-2006 04:36 AM
тАО06-23-2006 04:36 AM
Re: User able login after 3 failed attempts
This thread got me thinking about a script that sends email to users, say about a week before their password is about to expire...(on a trusted system). Has anyone written this and willing to share it?
TIA