- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- User Session
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
09-02-2004 02:15 AM
09-02-2004 02:15 AM
how is it possible, if is it, to limit a user to only one session per time?.. I want that a particular user runs a single session, not more than one at the same time.
thanx.
st.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2004 02:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2004 02:21 AM
09-02-2004 02:21 AM
Re: User Session
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2004 02:27 AM
09-02-2004 02:27 AM
Re: User Session
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2004 02:34 AM
09-02-2004 02:34 AM
Re: User Session
--
Note: this is for ALL users except root. For a single user to be restricted, you'll need to script the test in /etc/profile or /etc/csh.login.
--
ehm.. but how I can do that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2004 04:19 AM
09-02-2004 04:19 AM
Re: User Session
for ONESESS in bill joe carol jenny
do
CURRLOGIN=$(who -u | grep -c ^$ONESESS)
if [ $CURRLOGIN -ge 2 -a $(id -un) = $ONESESS ]
then
echo "\n\nNo more sessions allowed:"
ps -f -u $ONESESS
sleep 5
exit
fi
where: bill joe carol jenny
are the users that are only allowed 1 session. Expand/change that list as needed.
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-02-2004 04:47 AM
09-02-2004 04:47 AM
Re: User Session
Here is an alternate way of doing it
define all the users in a file say /etc/ONLYSINGLESES
# vi /etc/ONLYSINGLESES
user1
user2
user3
#
# vi /etc/profile
grep -qi "^${LOGNAME}$" /etc/ONLYSINGLESES >/dev/null 2>&1
if [ $? -eq 0 ]
then
COUNT=$(who -u | grep "^$LOGNAME " | wc -l)
if [[ $COUNT -gt 1 ]]
then
echo "Only one session allowed for user: $LOGNAME"
sleep 2
exit
fi
fi
couple of advantages to the above excerpt
1) You dont have to execute the loop for all the users all the time.
2) You can dynamically define the list in the file than having to edit the script when the changes are to be mode.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-09-2004 08:49 PM
09-09-2004 08:49 PM