LinuxQuestions.org
Register a domain and help support LQ
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 07-25-2005, 01:01 AM   #1
Mig21
Member
 
Registered: Jan 2005
Posts: 193

Rep: Reputation: 33
no /etc/limits ?


hello

i've been reading about creating limits. one way is to edit /etc/limits according to man limits. does that work in slackware? do i have to enable something? /etc/limits does not exist. i created one and it doesn't seem to limit anything, here's what i put into it:

Code:
dude  L2D2048U4
i can log in more then twice and ulimit -a doesn't show any extra limits

i am new to this security business

thanks in advance.
 
Old 07-25-2005, 06:13 AM   #2
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 740

Rep: Reputation: 81
Have you tried looking in /etc/login.defs? There's a ulimit section in there.

--Dane
 
Old 07-25-2005, 06:40 AM   #3
Mig21
Member
 
Registered: Jan 2005
Posts: 193

Original Poster
Rep: Reputation: 33
no. is that file used by `login`?

i just realized the file i created does work. only not over ssh. isn't that weird?

when loggin on directly at the machine or over telnet all the limits seem to be in place.

i have spent hours now trying to figure out why ssh logins ignore the /etc/limits file.

only suggestion i found was to enable UseLogin in sshd_config but then i cannot log in at all:
Code:
~$ ssh 10.0.0.2
dude@10.0.0.2's password:
usage: login [-p] [name]
       login [-p] [-h host] [-f name]
       login [-p] -r host
Connection to 10.0.0.2 closed.
is securing a linux machine supposed to be this difficult? not that windows is any better...

maybe i just need some sleep

cheers
 
Old 07-25-2005, 06:53 AM   #4
DaneM
Member
 
Registered: Oct 2003
Location: Chico, CA, USA
Distribution: Linux Mint
Posts: 740

Rep: Reputation: 81
Exactly what kind of limit are you trying to put into place? Are you trying to stop forkbombs? A little clarification would be helpful.

--Dane
 
Old 07-25-2005, 08:24 AM   #5
Mig21
Member
 
Registered: Jan 2005
Posts: 193

Original Poster
Rep: Reputation: 33
i have no specifics in mind. i want to make a secure linux system. people would have normal shell access (i hope that's possible)

forkbombs are one problem, but using up all the memory is just as bad. there are many things i want to take care of but for now the stuff described in `man limits`
 
Old 07-25-2005, 09:30 AM   #6
gbonvehi
Senior Member
 
Registered: Jun 2004
Location: Argentina (SR, LP)
Distribution: Slackware
Posts: 3,145

Rep: Reputation: 51
Did you try in login.defs as DaneM suggested? That file is read everytime you authentificate.
 
Old 07-25-2005, 06:41 PM   #7
imitheos
Member
 
Registered: May 2005
Location: Greece
Posts: 374

Rep: Reputation: 55
the ULIMIT option in login.defs is entirely different.

the limits infrastracture exists in slackware as in every other linux distribution.
I don't know why slackware doesn't ship with a sample /etc/limits, but if you create it yourself it works perfectly.
/bin/login reads it.

I use it for a long time.

The most easy options are the following:
N: max number of open files
U: max number of processes (stop forkbombs)
L: max number of logins for this user.

(There are other very useful options too, but you can easily mess your system, that is why i don't mention them)

if you try "man limits" you get a very simple description of it.
If you google, there are very good tutorials for it.
If i remember correctly the PAM version of limits (limits.conf) uses a different syntax. I mention this so that when you
read some articles you don't get confused about what is written.
You can very easily convert the PAM syntax to yours.

Hope i helped.
 
Old 07-26-2005, 12:18 AM   #8
Mig21
Member
 
Registered: Jan 2005
Posts: 193

Original Poster
Rep: Reputation: 33
Quote:
Did you try in login.defs as DaneM suggested? That file is read everytime you authentificate.
looks like login.defs is a config file for `login`. `login` never runs (see my post above about what happens when i try to enable it with sshd)

i tried it anyway. it's ignored.

Quote:
I don't know why slackware doesn't ship with a sample /etc/limits, but if you create it yourself it works perfectly.
/bin/login reads it.

I use it for a long time.
ooh.. please tell me you use ssh? i figured out how to use /etc/limits but it will not be used by ssh because ssh does not run /bin/login

thanks everyone for trying to help.
 
  


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
RAID Limits jtl60047 Linux - General 2 08-21-2004 10:06 PM
/etc/limits doesn't exist hampel Slackware 2 07-15-2003 12:26 PM
Limits on certain ip connections. newhost Linux - Security 3 03-09-2003 04:56 PM
trafic limits gekkie_007 Linux - Networking 1 02-23-2003 06:06 AM
Bandwidth Limits by IP Bomber Linux - Networking 3 01-16-2002 03:42 AM


All times are GMT -5. The time now is 08:27 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration