- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Limit amount of logins per user
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
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
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
тАО05-30-2001 09:00 AM
тАО05-30-2001 09:00 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-30-2001 09:24 AM
тАО05-30-2001 09:24 AM
Re: Limit amount of logins per user
There are two kernel parameters that might be creating problem for you:
nstrtel - number of opened telnet sessions
npty - number of pseudoterminal
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-30-2001 09:25 AM
тАО05-30-2001 09:25 AM
Re: Limit amount of logins per user
Richard
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-30-2001 10:40 AM
тАО05-30-2001 10:40 AM
Re: Limit amount of logins per user
nstrtel specifies the number of telnet device files that the kernel can support for incoming telnet sessions.
Acceptable Values:
Minimum
60
Maximum
Default
60
npty specifies the maximum number of pseudo-tty data structures that are available on the system.
Acceptable Values:
Minimum
1
Maximum
Memory limited
Default
60
A user 60 logins.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-30-2001 10:53 AM
тАО05-30-2001 10:53 AM
SolutionI don't thinkthere is a way to limit the number of times a user can log on to the system. Something you could possibly do is add something a one of the users . files or the /etc/profile or something that when they login, it counts the number of times they are already logged in, and if they exceed that number, it doesn't let them log in.
Something like this may work:
user=`echo $LOGNAME`
user_count=`who | grep $user | wc -l`
if ( $user_count > 2 ) then
echo "You have exceeded the max number of logins allowed
exit
fi
I can't guarantee that the syntax is absolutely correct, but you get the idea.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-30-2001 11:15 AM
тАО05-30-2001 11:15 AM
Re: Limit amount of logins per user
Patrick is correct there is no way to limit the logins per user. You could make the entries in the .profiles that he suggests but ,of course, your users could easily edit them and thus out bushwhack you. You could also
do the changes in /etc/profile which should only be writable by root; but, be very careful that nothing you do alters non-regular users (e.g. root).
The one time I had to do this for real, I had to code a c replacement for login. Fortunately, there were no graphical logins or a dtlogin replacement would have also been required. This is not an execise for the faint of heart but it is doable.
Regards, Clay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-30-2001 01:54 PM
тАО05-30-2001 01:54 PM
Re: Limit amount of logins per user
# Check for multiple logins
if [ -x "/usr/bin/whoami" ]
then
WHOAMI=`whoami`
if [ "$WHOAMI" = "root" -o then
:
else
# if [ `who | grep ^$WHOAMI | wc -l` -gt 1 ]
if [ `who | grep -c "^$WHOAMI"` -gt 1 ]
then
echo "\n\n W A R N I N G !"
echo "\nYou can't log in now because someone is logged"
echo "in with this user ID. If you think that"
echo "someone is using your account, please contact"
echo "the Shift Manager immediately....\n\n"
sleep 20
exit 1
fi
fi
fi
######
You can add other whoami's.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-30-2001 04:05 PM
тАО05-30-2001 04:05 PM
Re: Limit amount of logins per user
I had a similar problem a few years back and it
was solved by adding a login step. This entailed
creating a script in between /etc/profile and
$HOME/.profile. I have attached a copy of it
for you. The script checked to see what class
of user you were before continuing or logging
you out.
HTH
Michael