Date: Fri, 10 Mar 2006 13:36:16 -0500 (GMT-05:00) From: Michael Proto <protologic@mindspring.com> To: Dmitry Pryanishnikov <dmitry@atlantis.dp.ua>, Michael Proto <mike@jellydonut.org> Cc: freebsd-stable@freebsd.org Subject: Re: RELENG_4 on flash disk and swap Message-ID: <2838070.1142015777207.JavaMail.root@mswamui-thinleaf.atl.sa.earthlink.net>
next in thread | raw e-mail | index | archive | help
>On Fri, 10 Mar 2006, Michael Proto wrote: >> My suggestion would then be to utilize resource limits in >> /etc/login.conf for the sshd user (in your example) or other user >> accounts for applications that you don't want running out of control. >> See login.conf(5) and login_cap(3) for more details on this. In >> particular, the datasize, stacksize, memoryuse, and vmemoryuse options >> may be of benefit. > > OK, I'm aware about this measure. But have your tried it yourself against, >e.g., OpenSSH? I doubt it. Look at the following: > >dmitry@test$ ps axu |grep ssh >root 20213 0.0 1.3 54724 3356 ?? Is 4:00PM 0:00.10 sshd: dmitry > [priv] >dmitry 20216 0.0 1.3 54724 3356 ?? I 4:00PM 0:00.03 sshd: > dmitry@tty >root 20229 0.0 1.3 54724 3356 ?? Ss 4:00PM 0:00.10 sshd: dmitry > [priv] >dmitry 20232 0.0 1.3 54724 3356 ?? S 4:00PM 0:00.03 sshd: > dmitry@tty > >It's the result of 2 incoming OpenSSH sessions: 2 processes per session, >one of them root's and another user's. SSH.COM's sshd always works as a root. >Also, during the DoS attack (simultaneous setup of many incoming TCP >connections to 22th port) there will be many root's processes like this: > >root 20278 0.0 1.1 52016 2884 ?? Is 4:07PM 0:00.04 sshd: > [accepted] > >Do you really advise to lower root's limits? I'm sure you don't ;) > > >Sincerely, Dmitry >-- >Atlantis ISP, System Administrator >e-mail: dmitry@atlantis.dp.ua >nic-hdl: LYNX-RIPE You're correct, I could have sworn that sshd ran as the sshd user with the (somewhat) new privsep settings but it appears that I'm mistaken. My only other (albeit limited) suggestion would be to do something like inbound connection limiting that is available in pf to prevent the DOS-like scenarios you are mentioning. -Proto
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2838070.1142015777207.JavaMail.root>