- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: is there a way to reduce the amount of 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
06-29-2001 04:17 AM
06-29-2001 04:17 AM
is there a way to reduce the amount of logins per user?
I would like to reduce the amount of login-sessions for some users. Is there a way to do it under HPUX-11.00?
Regards:
Martin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2001 04:26 AM
06-29-2001 04:26 AM
Re: is there a way to reduce the amount of logins per user?
Sorry, no built in functionality for this .
You can do this from within /etc/profile by checking
if another session for this user already exists
i.e.
sess=`who | grep $LOGNAME | wc`
then check to see if $sess > 1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2001 04:45 AM
06-29-2001 04:45 AM
Re: is there a way to reduce the amount of logins per user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2001 05:09 AM
06-29-2001 05:09 AM
Re: is there a way to reduce the amount of logins per user?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-29-2001 05:14 AM
06-29-2001 05:14 AM
Re: is there a way to reduce the amount of logins per user?
num=1
u=$LOGNAME
case "$u" in
# Admin etc allowed multiple logins
'rsmith' |'root')
num=1;;
# All other users get 1 login only !
*)
num=`who | cut -d" " -f1 | grep "^$LOGNAME"$|wc -l`
esac
if [ $num -gt 1 ]
then
echo You are already logged into this system
echo Please close your existing session before
echo trying again.
exit
fi
Hope this helps.
Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2001 01:14 PM
06-30-2001 01:14 PM
Re: is there a way to reduce the amount of logins per user?
You can control user logins by the use of the free text field in the passwd file.
Enter the max number of logins allowed for that user in that field.
When they login push them via their .profile through a check script:- count their logins, who -u|grep
So if greater than then:- "Sorry your maximum number of logins has been exceeded" and exit them.
Another option is to hold the user login names in a seperate file with the max number next to it:-
So:-
freddy 3
billy 2
sarah 4
And when they login refer to this file.
I have used both methods and both work well.
HTH
Paula