LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 12-09-2002, 02:16 AM   #1
juno
Member
 
Registered: Sep 2002
Location: fdas
Posts: 100

Rep: Reputation: 15
Limit no. of login


How to limit the max. no. user of login to the linux system? Thx.
 
Old 12-09-2002, 04:30 AM   #2
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
What are you actually trying to accomplish by limiting the number of users allowed to login? Wouldn't you be better off limiting what users are allowed to do instead of limiting the amount of users. It only takes one user to bring a system to a crawl by stealing all the resources.
Have you looked at the possibilities of PAM? If never really got into using it but it has lots of different possibilities of limiting access.
If you can't find anything with PAM you could always write a simple script which disables users from logging in.

Code:
if [ `w -h | wc -l` -gt 10 ]
then
  echo "Too many users" > /etc/nologin
else
  rm -f /etc/nologin
fi
You could run that from cron or have it triggered when a new user logs in.
 
Old 12-09-2002, 04:48 AM   #3
juno
Member
 
Registered: Sep 2002
Location: fdas
Posts: 100

Original Poster
Rep: Reputation: 15
I didn't find the /etc/nologin file , should i create one? how to use the file ? thx.
 
Old 12-09-2002, 04:55 AM   #4
Mik
Senior Member
 
Registered: Dec 2001
Location: The Netherlands
Distribution: Ubuntu
Posts: 1,316

Rep: Reputation: 47
You shouldn't have that file. The program login checks for that file. If it is present then it displays the contents of the file to the terminal and then closes the connection. Read 'man login' for more information. If the file is present then nobody will be allowed to login into the system. Even root will not be allowed to login so you should be careful how you use it.
 
Old 12-09-2002, 10:30 AM   #5
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
You could always use xinetd to control the total number of connections and the connections per source.
 
Old 12-10-2002, 03:27 AM   #6
juno
Member
 
Registered: Sep 2002
Location: fdas
Posts: 100

Original Poster
Rep: Reputation: 15
Hi stickman,

Can suggest how to use xinetd to control the login ? thx.
 
Old 12-10-2002, 03:51 AM   #7
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
like mik said, WHY are you trying to do this? It's a slightly bizarre apparoach you seem to have thougth of, as it's easy to be logged in to your own system 3 or 4 times from just from opening terminals. I would think it very likely that there is a much ore elegant solution to what you are trying to do.
 
Old 12-12-2002, 02:38 PM   #8
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Quote:
Originally posted by juno
Can suggest how to use xinetd to control the login ? thx.
You can do this by setting the instances and per_source values in xinetd.conf. This will at least allow you to throttle any service that get started via xinetd.
 
  


Reply



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 On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Debian, Winbind: how to limit user login franz130175 Linux - Networking 2 01-20-2013 12:00 PM
proftpd (Router port change and limit login rule) icehenge Slackware 2 03-07-2005 03:23 PM
Is there a way to limit login attempts in RHL 7.3? RickMean Linux - Security 1 12-24-2004 08:54 PM
Limit the amount of login attempts to machine jester_69 Linux - Security 4 10-14-2003 02:35 PM
vsftp - limit login attempts bandersson Linux - Security 0 01-01-2003 04:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:49 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