HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Repost - Is there an easy way to limit concurrent ...
Operating System - HP-UX
1825720
Members
2905
Online
109686
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
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
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
03-21-2007 10:27 PM
03-21-2007 10:27 PM
Repost - Is there an easy way to limit concurrent login sessions?
This is a repost of the corrupted thread linked here:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1113
I have recovered the replies to this thread that are not showing. I don't have exact timestamps, just dates. Hope this helps
Gary
*****************************
Original Question:
Peter Floyd
2000-01-05
I am in need of an easy way to limit the number of concurrent login session any
given user can have. If anyone knows, please respond to my email address and/or
post in this forum. Thank you.
*************************************
Charles Guiocheau
2000-01-06
Hello there,
In your /etc/profile add the following lines
USER=$(whoami)
NBCNX=`who -H | grep ${USER} | grep -v root | wc -l`
if [ ${NBCNX} -gt 2 ]
then
echo "MSG login restrited"
exit
fi
regards
*****************************
Javier Juarez
2000-01-06
another easy response for your question, add the next pharagraph in the file
/etc/profile
.
.
trap 1 2 3
if [ "$LOGNAME" != "root" ]
then
if [ `who -u | awk ?{ print $1}?|grep "$LOGNAME"
| wc -l ` -gt 1 ]
then
clear
echo "Number of Conecctions Exceeded"
echo "CONECTION REFUSED"
exit
fi
fi
.
.
.
.
Regards.
***************************
R Madhavan
2000-01-06
The easy way i can suggest is to write a few lines script which count for
number of $LOGNAME for that login id and exit if it is above your limit. Call
this script thro' /etc/profile.
Hope this helps you.
*********************************
Tan Pau Cen
2007-03-21
Hi there,
You can set NUMBER_OF_LOGINS_ALLOWED in /etc/default/security file.
$ man 4 security
...
NUMBER_OF_LOGINS_ALLOWED
This parameter controls the number of simultaneous logins allowed per user. This is applicable only for non-root users.
NUMBER_OF_LOGINS_ALLOWED=0 Any number of logins are allowed per user.
NUMBER_OF_LOGINS_ALLOWED=N N number of logins are allowed per user.
Default value: NUMBER_OF_LOGINS_ALLOWED=0
-----------
Hope this helps.
******************************
Biswajit Tripathy
2007-03-21
You could use IPFilter system firewall to
limit the number of telnet/ssh/rlogin sessions,
but it will only let you set the limit per IP address
and not per user. If a user is tied to a particular
IP address in your network, then IPFilter is
the quick and easy solution.
- Biswajit
***************************
A. Clay Stephenson
2007-03-21
By far, the easist method is to edit /etc/default/security (you may need to create this file) and add an entry:
NUMBER_OF_LOGINS_ALLOWED=n.
Man security for details.
*****************************
Pete Randall
2007-03-21
Do a man on security, then set up a file called /etc/default/security with the NUMBER_OF_LOGINS parameter specified per your requirements.
Pete
******************************
Anshumali
2007-03-22
I am not sure of any inbuilt way of HP-UX to prevent a user from logging in more than one session concurrently. What i will do is, add the below lines into /etc/profile to check if the user is already logged in and if thats the case, don't let them log in again. Like...
LOGIN_SESS=`who | grep $LOGNAME | wc -l`
if ( $LOGIN_SESS >= 1 )
then
echo "You are already logged on this system."
echo "No more sessions allowed."
exit
fi
User can always modify it though.
*******************************
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1113
I have recovered the replies to this thread that are not showing. I don't have exact timestamps, just dates. Hope this helps
Gary
*****************************
Original Question:
Peter Floyd
2000-01-05
I am in need of an easy way to limit the number of concurrent login session any
given user can have. If anyone knows, please respond to my email address and/or
post in this forum. Thank you.
*************************************
Charles Guiocheau
2000-01-06
Hello there,
In your /etc/profile add the following lines
USER=$(whoami)
NBCNX=`who -H | grep ${USER} | grep -v root | wc -l`
if [ ${NBCNX} -gt 2 ]
then
echo "MSG login restrited"
exit
fi
regards
*****************************
Javier Juarez
2000-01-06
another easy response for your question, add the next pharagraph in the file
/etc/profile
.
.
trap 1 2 3
if [ "$LOGNAME" != "root" ]
then
if [ `who -u | awk ?{ print $1}?|grep "$LOGNAME"
| wc -l ` -gt 1 ]
then
clear
echo "Number of Conecctions Exceeded"
echo "CONECTION REFUSED"
exit
fi
fi
.
.
.
.
Regards.
***************************
R Madhavan
2000-01-06
The easy way i can suggest is to write a few lines script which count for
number of $LOGNAME for that login id and exit if it is above your limit. Call
this script thro' /etc/profile.
Hope this helps you.
*********************************
Tan Pau Cen
2007-03-21
Hi there,
You can set NUMBER_OF_LOGINS_ALLOWED in /etc/default/security file.
$ man 4 security
...
NUMBER_OF_LOGINS_ALLOWED
This parameter controls the number of simultaneous logins allowed per user. This is applicable only for non-root users.
NUMBER_OF_LOGINS_ALLOWED=0 Any number of logins are allowed per user.
NUMBER_OF_LOGINS_ALLOWED=N N number of logins are allowed per user.
Default value: NUMBER_OF_LOGINS_ALLOWED=0
-----------
Hope this helps.
******************************
Biswajit Tripathy
2007-03-21
You could use IPFilter system firewall to
limit the number of telnet/ssh/rlogin sessions,
but it will only let you set the limit per IP address
and not per user. If a user is tied to a particular
IP address in your network, then IPFilter is
the quick and easy solution.
- Biswajit
***************************
A. Clay Stephenson
2007-03-21
By far, the easist method is to edit /etc/default/security (you may need to create this file) and add an entry:
NUMBER_OF_LOGINS_ALLOWED=n.
Man security for details.
*****************************
Pete Randall
2007-03-21
Do a man on security, then set up a file called /etc/default/security with the NUMBER_OF_LOGINS parameter specified per your requirements.
Pete
******************************
Anshumali
2007-03-22
I am not sure of any inbuilt way of HP-UX to prevent a user from logging in more than one session concurrently. What i will do is, add the below lines into /etc/profile to check if the user is already logged in and if thats the case, don't let them log in again. Like...
LOGIN_SESS=`who | grep $LOGNAME | wc -l`
if ( $LOGIN_SESS >= 1 )
then
echo "You are already logged on this system."
echo "No more sessions allowed."
exit
fi
User can always modify it though.
*******************************
1 REPLY 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-22-2007 01:51 AM
03-22-2007 01:51 AM
Re: Repost - Is there an easy way to limit concurrent login sessions?
I see an other way writing a simple PAM module.
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
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP