- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- need to check IP address before allowing login to ...
Operating System - HP-UX
1752793
Members
5772
Online
108789
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО10-14-2009 05:03 AM
тАО10-14-2009 05:03 AM
I have been searching for a way to do this. We want to stop simultaneous logins with identical UserIDs established from different computers will be blocked. Users will be allowed to have 6 sessions open on the same computer. If you have any script ideas let me know.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2009 05:10 AM
тАО10-14-2009 05:10 AM
Re: need to check IP address before allowing login to app
Hi,
1) Install & configure SSH.
Use /etc/hosts.allow & /etc/deny after installing SSH.
2) Use system in Trusted mode.
3) Configure bastille.
1) Install & configure SSH.
Use /etc/hosts.allow & /etc/deny after installing SSH.
2) Use system in Trusted mode.
3) Configure bastille.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2009 05:18 AM
тАО10-14-2009 05:18 AM
Re: need to check IP address before allowing login to app
I am not sure is there any tool in native HP-UX to limit multi-user number ? But , I think it can be written a code to do:
Pseudo Code:
#!/bin/ksh
# How many user1 around
kim=`who |grep user1 |wc -l`
if (( $kim >= 6 ))
then
user1 reached limit!
else
permit user. .
fi
Pseudo Code:
#!/bin/ksh
# How many user1 around
kim=`who |grep user1 |wc -l`
if (( $kim >= 6 ))
then
user1 reached limit!
else
permit user. .
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-14-2009 08:56 AM
тАО10-14-2009 08:56 AM
Solution
something along the lines of the following allow you to limit the maximum number of logins. it also allows you to limit the number of different locations they login from. its not been checked with background / nohup jobs running. you'd need to put something similar in either the system-wide profile or the users profile. if installed system-wide, you may want to wrap it in a test that excludes certain users (or at least root) from running the test.
#!/usr/bin/ksh
LoginLimit=3
OtherLocLimit=0
My_IP=$(who am i | awk '{print $NF}')
My_Name=$(whoami)
My_Login_Ct=$(who | grep $My_Name | wc -l)
My_Other_IP=$(who | grep $My_Name | grep -v $My_IP | awk '{print $NF}' | sort -u | wc -l )
if [ $My_Login_Ct -le $LoginLimit ]
then
echo Login count OK
else
echo Number of attempted logins exceeds limit \($LoginLimit\)
# exit here as appropriate
fi
if [ $My_Other_IP -gt $OtherLocLimit ]
then
echo Logged in at the following other locations:
who | grep $My_Name | grep -v $My_IP | awk '{print $NF}' | sort -u
# exit here as appropriate
else
echo You are logged in at $My_Other_IP locations. The limit is currently $OtherLocLimit
fi
#!/usr/bin/ksh
LoginLimit=3
OtherLocLimit=0
My_IP=$(who am i | awk '{print $NF}')
My_Name=$(whoami)
My_Login_Ct=$(who | grep $My_Name | wc -l)
My_Other_IP=$(who | grep $My_Name | grep -v $My_IP | awk '{print $NF}' | sort -u | wc -l )
if [ $My_Login_Ct -le $LoginLimit ]
then
echo Login count OK
else
echo Number of attempted logins exceeds limit \($LoginLimit\)
# exit here as appropriate
fi
if [ $My_Other_IP -gt $OtherLocLimit ]
then
echo Logged in at the following other locations:
who | grep $My_Name | grep -v $My_IP | awk '{print $NF}' | sort -u
# exit here as appropriate
else
echo You are logged in at $My_Other_IP locations. The limit is currently $OtherLocLimit
fi
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP