--------------------------
 ssh 1.2.27 limits patch by [Ultor@sowatech.com.pl]
-------------------------

1. DESCRIPTION
2. INSTALLATION
3. INSTALLATION FOR DUMMIES
4. TEST
5. GREETZ

1. DESCRIPTION ================

I had some problems with resource limits in ssh 1.2.27. I  was describing
limits in  /etc/limits (man limits for info) file but sshd never used it.
Some people said to use  "UseLogin yes"  option in  /etc/sshd_config  but
the effect was the same :(. I've tested some patches available on the net
and the  effect was the same too  so i've decided to  patch it on my own.
So this is the  ssh 1.2.27  patch which adds  /etc/limits  usage to sshd.


2. INSTALLATION ===============

It is very easy. Just copy all files to  ssh-1.2.27 and run ./PATCHLIMITS
Remember to do it before you'll start to ./configure ssh. It's good to do
'make clean' on ssh first. 


3. INSTALLATION FOR DUMMIES ===

Ok so u're newbie. This example should help you.

ultor:/dummie# ls
ssh-1.2.27.tgz         ssh_limits_patch.tgz
ultor:/dummie# gzip -d ssh-1.2.27.tar.gz
ultor:/dummie# tar -xvf ssh-1.2.27.tar
ultor:/dummie# ls -al
total 4832
drwxr-xr-x   3 root     root         1024 Nov 15 22:33 ./
drwxr-xr-x  22 root     root         1024 Nov 15 22:32 ../
drwxr-xr-x   4 17275    20           3072 May 12  1999 ssh-1.2.27/
-rw-------   1 root     root      4915200 Sep  9  2000 ssh-1.2.27.tar
-rw-r--r--   1 root     root         6593 Nov 15 22:32 ssh_limits_patch.tgz
ultor:/dummie# gzip -d ssh_limits_patch.tgz
ultor:/dummie# tar -xvf ssh_limits_patch.tar
ultor:/dummie# ls
ssh-1.2.27/            ssh-1.2.27.tar         ssh_limits_patch/
ssh_limits_patch.tar
ultor:/dummie# cp ssh_limits_patch/* ssh-1.2.27
ultor:/dummie# cd ssh-1.2.27
ultor:/dummie/ssh-1.2.27#
ultor:/dummie/ssh-1.2.27# ./PATCHLIMITS
----------------------------------------
    ssh 1.2.27 limits patch by Ultor
        [Ultor@sowatech.com.pl]
----------------------------------------
-= Doing limits.o ....
-= OK limits.o done
-= Patching Makefile.in ...
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- Makefile.in.orig   Wed May 12 13:19:31 1999
|+++ Makefile.in        Mon Nov 15 20:30:58 1999
--------------------------
Patching file Makefile.in using Plan A...
Hunk #1 succeeded at 323.
done
-= Patching sshd.c ...
Hmm...  Looks like a unified diff to me...
The text leading up to this was:
--------------------------
|--- sshd.c.orig        Wed May 12 13:19:29 1999
|+++ sshd.c     Mon Nov 15 22:02:18 1999
--------------------------
Patching file sshd.c using Plan A...
Hunk #1 succeeded at 1.
Hunk #2 succeeded at 441.
Hunk #3 succeeded at 753.
Hunk #4 succeeded at 4481.
Hunk #5 succeeded at 4560.
Hunk #6 succeeded at 4597.
done
-= OK DONE ?
ultor:/dummie/ssh-1.2.27# ./configure
.. and then 'make all' and 'make install' but u should know that.

How to use limits ?

All limits are described in /etc/limits file ('man limits' for more info).
Here u got example of resource limits described for user ultor.

ultor:/etc# cat limits
ultor C0D10240F5000S1500N25U15M5000R5000L2


4. TEST =======================

Ok here is the test of the patch.

OS: Linux Slackware 3.9 (kernel 2.0.38).

ultor:/# ls -al /etc/limits
-rwxr-xr-x   1 root     root           43 Nov 15 21:28 /etc/limits
ultor:/dummie/ssh-1.2.27# ssh -l ultor localhost
ultor@127.0.0.1's password:
Last login: Mon Nov 15 21:25:13 1999 from localhost
Linux 2.0.38.
You have mail.
ultor:~$ ulimit -a
core file size (blocks)  0
data seg size (kbytes)   10240
file size (blocks)       5000
max memory size (kbytes) 5000
stack size (kbytes)      1500
cpu time (seconds)       unlimited
max user processes       15
pipe size (512 bytes)    8
open files               25
virtual memory (kbytes)  11740
ultor:~$ ulimit -c 5
ulimit: cannot raise limit: Operation not permitted

Ok as you see it works fine :))) ... so i think that's all.

5. GREETZ

Ok so only main greetz here :)

GREETZ TO ALL FRIENDS ON: #PLUG #HAX #SLACKWARE #C

--------- Life sux and then you die

________________________________________________________
Ultor [Ultor@sowatech.com.pl] - Network Security Adviser
I hack the heads of little girls and put them on my wall
