- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Limiting UNIX Logins
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
Forums
Discussions
Discussions
Discussions
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
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
12-07-2000 02:33 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2000 02:47 PM
12-07-2000 02:47 PM
Re: Limiting UNIX Logins
One thought that comes to mind is to put something in the users .profile of .?shrc file that would do something like 'who | grep username' and if a value is returned then do an exit so it terminates their session.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2000 03:06 PM
12-07-2000 03:06 PM
SolutionEnjoy !
...Madhu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2000 04:53 AM
12-08-2000 04:53 AM
Re: Limiting UNIX Logins
Try this in the default profile :
no_of_users=`ps -ef|grep -v root ( or other users that you need to run on the system like oracle or so )|grep -v grep |wc -l`
export no_of_users
#
if test "$no_of_users" -gt 20
then
tput clear
echo "More than 20 users logged in......"
echo "Number of users logged in: $no_of_users"
echo "exiting......"
sleep 2
exit 1
else
do something
fi
rgds
Alexander M. Ermes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2000 05:07 AM
12-08-2000 05:07 AM
Re: Limiting UNIX Logins
Sorry, instead of ps -ef you better use who -u
to find out, how many users you have one the system
Rgds
Alexander M. Ermes
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2000 07:37 AM
12-08-2000 07:37 AM
Re: Limiting UNIX Logins
The profile included specific groups that were limited to one login per user.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2000 07:51 AM
12-08-2000 07:51 AM
Re: Limiting UNIX Logins
One way to do it and be very specific for each user is to use the passwd file as a reference and give use user a tel number for the number of logins required.
So in their .profile see if they are logged in , count their logins and look at the passwd file, so if login is greater that passwd allow exit.
I had a script to do this but cannot find it.
I have used this method and it works file.
Paula
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2000 11:12 AM
12-08-2000 11:12 AM
Re: Limiting UNIX Logins
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2000 11:36 AM
12-08-2000 11:36 AM
Re: Limiting UNIX Logins
ps -fu$LOGNAME | awk -v MYPID=$$ -v UNAME=$LOGNAME -f check.dup.login
I can then tell the user he/she has another session running, and even ask if they would like to kill it.
I only look for sessions called "UV" (uniVerse) to count. See attached awk script.