LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 06-07-2006, 06:40 PM   #1
MichaelP
Member
 
Registered: Jul 2004
Location: Dominica
Distribution: CentOS
Posts: 35

Rep: Reputation: 15
Prevent a single user from multiple simultaneous logins


How do I prevent a single user from multiple simultaneous logins?

Server: CentOS 4.3 with Samba, Clients: Win98, Win2000

When I do maintenance I log in on all the windows 98 and 2000 client machines as the same administrative user and do my job. But, this is a school environment and I do not want students sharing passwords during a test and sharing the same file. So i need to prevent the same user from logging on more than once at the same time.
Oh ... Exams begin next week.... Help
 
Old 06-07-2006, 07:19 PM   #2
bulliver
Senior Member
 
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Blog Entries: 4

Rep: Reputation: 78
Code:
# echo "* L1" >> /etc/limits
See man 5 limits...
 
Old 06-07-2006, 07:42 PM   #3
MichaelP
Member
 
Registered: Jul 2004
Location: Dominica
Distribution: CentOS
Posts: 35

Original Poster
Rep: Reputation: 15
Thanks

I will try tomorrow when I get access to the server. I also noticed some other restrictions/limits I could apply.
 
Old 06-07-2006, 10:56 PM   #4
bulliver
Senior Member
 
Registered: Nov 2002
Location: British Columbia, Canada
Distribution: Gentoo x86_64; FreeBSD; OS X
Posts: 3,764
Blog Entries: 4

Rep: Reputation: 78
No Prob.

I am not sure if the '*' wildcard to specify the user includes root so watch for that...
 
Old 06-08-2006, 07:42 AM   #5
MichaelP
Member
 
Registered: Jul 2004
Location: Dominica
Distribution: CentOS
Posts: 35

Original Poster
Rep: Reputation: 15
Can't seem to get man limits in CentOS not FC5 or maybe i am up to early. Help anyone
 
Old 06-08-2006, 08:21 AM   #6
MichaelP
Member
 
Registered: Jul 2004
Location: Dominica
Distribution: CentOS
Posts: 35

Original Poster
Rep: Reputation: 15
I found /etc/security/limits.conf in CentOS. Looks like what I am looking for.
 
Old 03-12-2008, 11:11 AM   #7
MichaelP
Member
 
Registered: Jul 2004
Location: Dominica
Distribution: CentOS
Posts: 35

Original Poster
Rep: Reputation: 15
The Limits idea did not work. Maybe I am not too sure on how to do, however I found a solution for
Limiting Logon Connections at http://us4.samba.org/samba/docs/man/...html#id2655826 and this is what I did but need help understanding what I did.

I created/copied a script "PermitSingleLogon.sh" with permissions 755 and placed it in the /etc/samba directory. Here is the script

#!/bin/bash

IFS="-"
RESULT=$(smbstatus -S -u $1 2> /dev/null | awk 'NF > 6 {print $1}' | sort | uniq -d)

if [ "X${RESULT}" == X ]; then
exit 0
else
exit 1
fi

Then I added the two lines to my netlogon share in the smb.conf file

[netlogon]
...
preexec script = /etc/samba/PermitSingleLogon.sh
preexec close = Yes

...

This works but only if the user tries to logon on the different machines within a few minutes after the initial logon (I will time this later). The Samba-HOW-TO link I used says "This is not a perfect solution because Windows clients can drop idle connections with an auto-reconnect capability that could result in the appearance that a share is no longer in use, while actually it is"

QUESTIONS:
1. How do I stop Windows form dropping the connection?
2. I have already checked the man pages but still need to know,
What does this part of the above script do? awk 'NF > 6 {print $1}'
and if [ "X${RESULT}" == X ]
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
multiple simultaneous logins phonecian Linux - Newbie 6 06-05-2005 10:40 AM
Creating multiple users in Kmail with a single KDE user jonole Linux - Software 3 10-03-2004 01:36 AM
Can I have multiple desktop/manager options with single user? timsch75 Slackware 5 08-18-2004 06:10 PM
Multiple simultaneous VPN connections? chamitha Linux - Networking 3 08-29-2002 01:28 AM
Multiple simultaneous VPN connections? chamitha Linux - General 1 08-28-2002 05:11 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 12:26 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration