- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script Help
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
тАО10-15-2002 09:16 AM
тАО10-15-2002 09:16 AM
Ie, our application can only have 32 users but we are lacking the tool to restrict this within the application at this time.
Once the 32 user count is hit, then send an email message to the user and also record the login attempt in a log file under /tmp.
Lastly, there will be a two users that should be exempt from this, ie the two sys admins.
Can anyone help me with this?
Thank you,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2002 09:28 AM
тАО10-15-2002 09:28 AM
Re: Script Help
Easiest solution:
Add this to /etc/profile:
if [ $(id -u) -ne 0 -a $(users | sed 's/root//g' | wc -c) -gt 32 ]; then exit 1; fi
I'm sure of the equivalent for CSH in /etc/csh.login, so I'll let others work that out.
Another solution is to reconfigure the kernel by reducing npty.
You should also concider restricting how many times each user may be logged in by defining NUMBER_OF_LOGINS_ALLOWED=5 in /etc/default/security.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2002 09:30 AM
тАО10-15-2002 09:30 AM
Re: Script Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2002 09:49 AM
тАО10-15-2002 09:49 AM
Re: Script Help
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2002 09:59 AM
тАО10-15-2002 09:59 AM
Re: Script Help
Sorry... I'm working on that part... Having a little trouble with regular expressions in sed...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2002 10:40 AM
тАО10-15-2002 10:40 AM
SolutionOkay, sorry about the wait. Try the attached snippet for /etc/profile.
Make sure your admins are part of the group adm (or any other that you specify) so that they are excluded from the user count. Also, root bypasses this check and is excluded from the count as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-15-2002 10:48 AM
тАО10-15-2002 10:48 AM
Re: Script Help
A question.
Does the users actually log in on this host and start the application with a command or is it some kind of client-server application. In the later case is the user not realy logged in to the host and tracking users logged in will perhaps not work.
Another idea could be to check how many instances of the application is running before starting a new
if ['ps -ef |grep
then
"do something (logout for example)"
else
app_start
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО10-21-2002 04:16 AM
тАО10-21-2002 04:16 AM
Re: Script Help
Cheers,
Nickd