- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: how to prevent users logging in more than once...
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-19-2006 11:49 PM
06-19-2006 11:49 PM
how to prevent users logging in more than once?
i like to know the same thing for sun solaris.
thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2006 12:11 AM
06-20-2006 12:11 AM
Re: how to prevent users logging in more than once?
in the user .profile you can add a line that start a script like this:
number_conn=who|grep -c username
if [ $number_conn > num_conn_you_want ]; then
exit
fi
The script should not have write permission for user
Enrico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2006 12:13 AM
06-20-2006 12:13 AM
Re: how to prevent users logging in more than once?
Enrico
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2006 12:15 AM
06-20-2006 12:15 AM
Re: how to prevent users logging in more than once?
HPUX:
Modify file /etc/security/defaults
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
man security
rgs,
ran
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2006 12:22 AM
06-20-2006 12:22 AM
Re: how to prevent users logging in more than once?
in /etc/profile
LOGINS=$(who | grep $LOGNAME |wc -l)
if [ $LOGINS -ge 1 ]
echo "Multiple logins not permitted. bad little boys and girls.... Shame on you."
exit 1
else
"Logging in a well behaved user"
fi
Don't use my text, I'm trying to be funny.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2006 12:22 AM
06-20-2006 12:22 AM
Re: how to prevent users logging in more than once?
in /etc/profile
LOGINS=$(who | grep $LOGNAME |wc -l)
if [ $LOGINS -ge 1 ]
echo "Multiple logins not permitted. bad little boys and girls.... Shame on you."
exit 1
else
echo "Logging in a well behaved user"
fi
Don't use my text, I'm trying to be funny.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2006 01:28 AM
06-20-2006 01:28 AM
Re: how to prevent users logging in more than once?
2.) is this same for sun solaris also?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2006 01:35 AM
06-20-2006 01:35 AM
Re: how to prevent users logging in more than once?
1: put a logon script inside /etc/skel/.profile that does what above scripts do with logon checks. Make sure it's owned by a user like bin and group-owned by bin (or root/bin), and chmod'd 444.
2: for existing users, do something like this:
for i in `cat /etc/passwd | awk -F: '{ if ( $3 >= 100 ) { print $1 } }'`
do
cp /etc/skel/.profile /home/$i/.profile
chmod 444 /home/$i/.profile
done
This way you secure the .profile against typical modifications and everyone's covered with step #2. The only problem would be specific users who have sudo access that allows them to vi, pico, whatever.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2006 02:00 AM
06-20-2006 02:00 AM
Re: how to prevent users logging in more than once?
/etc/profile is executed by all POSIX shells including ksh, bash and HP's POSIX shell, and also by the Bourne shell (/usr/old/bin/sh in HP-UX). The man page for each shell gives the details about startup (login).
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2006 02:17 AM
06-20-2006 02:17 AM
Re: how to prevent users logging in more than once?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-20-2006 06:55 AM
06-20-2006 06:55 AM
Re: how to prevent users logging in more than once?
Bill Hassell, sysadmin