- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Restrict logins if already logged into system from...
Operating System - HP-UX
1822475
Members
2705
Online
109642
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
Forums
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
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
тАО12-14-2001 07:06 AM
тАО12-14-2001 07:06 AM
I would like to prevent users from logging in from more than one IP address.
The users are logging on from multiple workstations and letting others use their security permissions. This is not company policy or practice, therefore I would like to have the system (probably /etc/profile) look to see if they are already logged onto the Unix server from one IP address.
If they are already logged on from another IP address, then display a msg and prohibit them from loggin on.
Of course, there has to be some exceptions to this list, and that would be me, sysadmin.
The users are logging on from multiple workstations and letting others use their security permissions. This is not company policy or practice, therefore I would like to have the system (probably /etc/profile) look to see if they are already logged onto the Unix server from one IP address.
If they are already logged on from another IP address, then display a msg and prohibit them from loggin on.
Of course, there has to be some exceptions to this list, and that would be me, sysadmin.
Always learning
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2001 07:42 AM
тАО12-14-2001 07:42 AM
Re: Restrict logins if already logged into system from one ip address
the who -a will give the source ip of the login. YOU may be able to put that in /etc/profile so it's gets run when everyone logs in. Then see if there are any differences with the user IPs. The problem is this won't work if users can rlogin from unix box to unix box (because the source ip will be of that unix machine)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2001 08:34 AM
тАО12-14-2001 08:34 AM
Re: Restrict logins if already logged into system from one ip address
You can add a call to this script from /etc/profile, and based on the return code either let the user in, or not:
#!/bin/ksh
trap "" 1 2 3
IP_LIST=`who -u|tr -s " "|cut -d" " -f8`
THIS_IP=`who -um|tr -s " "|cut -d" " -f8`
LOGIN_COUNT=0
for IP_ADDY in `echo $IP_LIST`; do
if [ "${IP_ADDY}" -eq "${THIS_IP}" ]; then
(( LOGIN_COUNT = LOGIN_COUNT + 1 ))
fi
done
echo $LOGIN_COUNT
if [ $LOGIN_COUNT -gt 1 ]; then
exit 1
else
exit 0
fi
--
mark
#!/bin/ksh
trap "" 1 2 3
IP_LIST=`who -u|tr -s " "|cut -d" " -f8`
THIS_IP=`who -um|tr -s " "|cut -d" " -f8`
LOGIN_COUNT=0
for IP_ADDY in `echo $IP_LIST`; do
if [ "${IP_ADDY}" -eq "${THIS_IP}" ]; then
(( LOGIN_COUNT = LOGIN_COUNT + 1 ))
fi
done
echo $LOGIN_COUNT
if [ $LOGIN_COUNT -gt 1 ]; then
exit 1
else
exit 0
fi
--
mark
the future will be a lot like now, only later
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО12-14-2001 09:18 AM
тАО12-14-2001 09:18 AM
Solution
Hi there.
Pls check this URL :
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x431472106351d5118fef0090279cd0f9,00.html
You hsould find the answer in these postings.
Rgds
Alexander M. Ermes
Pls check this URL :
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x431472106351d5118fef0090279cd0f9,00.html
You hsould find the answer in these postings.
Rgds
Alexander M. Ermes
.. and all these memories are going to vanish like tears in the rain! final words from Rutger Hauer in "Blade Runner"
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.
Company
Learn About
News and Events
Support
© Copyright 2025 Hewlett Packard Enterprise Development LP