From owner-freebsd-current@FreeBSD.ORG Fri Aug 1 12:27:02 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4DF4010656A0 for ; Fri, 1 Aug 2008 12:27:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from mail.zoral.com.ua (skuns.zoral.com.ua [91.193.166.194]) by mx1.freebsd.org (Postfix) with ESMTP id 99B728FC2C for ; Fri, 1 Aug 2008 12:27:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (root@deviant.kiev.zoral.com.ua [10.1.1.148]) by mail.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m71CQeJr011591 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 1 Aug 2008 15:26:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: from deviant.kiev.zoral.com.ua (kostik@localhost [127.0.0.1]) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2) with ESMTP id m71CQeol070528; Fri, 1 Aug 2008 15:26:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) Received: (from kostik@localhost) by deviant.kiev.zoral.com.ua (8.14.2/8.14.2/Submit) id m71CQe76070527; Fri, 1 Aug 2008 15:26:40 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: deviant.kiev.zoral.com.ua: kostik set sender to kostikbel@gmail.com using -f Date: Fri, 1 Aug 2008 15:26:40 +0300 From: Kostik Belousov To: Ed Schouten Message-ID: <20080801122640.GH97161@deviant.kiev.zoral.com.ua> References: <20080801121004.GO99951@hoeg.nl> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="NWFdL9cNbHaIJHRV" Content-Disposition: inline In-Reply-To: <20080801121004.GO99951@hoeg.nl> User-Agent: Mutt/1.4.2.3i X-Virus-Scanned: ClamAV version 0.93.3, clamav-milter version 0.93.3 on skuns.kiev.zoral.com.ua X-Virus-Status: Clean X-Spam-Status: No, score=-4.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on skuns.kiev.zoral.com.ua Cc: karim.bourenane@orange-ftgroup.com, FreeBSD Current Subject: Re: [BSD6] SSH Restriction X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 01 Aug 2008 12:27:02 -0000 --NWFdL9cNbHaIJHRV Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Aug 01, 2008 at 02:10:04PM +0200, Ed Schouten wrote: > Hello Karim, >=20 > * karim.bourenane@orange-ftgroup.com = wrote: > > I have one question. How i can restrict ( limit ) 1 user to have for > > exemple 5 ssh connection in simutanous time, no more ? >=20 > It's quite funny you ask this question, because I've been working on > this last week. >=20 > The new TTY code, which I'll commit next week, adds a new rlimit to the > kernel called RLIMIT_NPTS. This rlimit allows you to limit the number of > pseudo-terminals allocated by a single user. This means you can limit > the number of login sessions by tuning the "pseudoterminals" field in > /etc/login.conf. >=20 > This seems to work with tools like screen(1), xterm(1), etc. > Unfortunately I didn't get it working with OpenSSH, because OpenSSH > allocates terminals while been root. I've already contacted the OpenSSH > folks about this, but I haven't got any response (yet). Limit on the allocation of the ptys is useful. Trying to use it to top the number of the "sessions" may be not. There is a -T option for the ssh(= 1). Without clear description of why the restriction is imposed, the question probably cannot be answered. --NWFdL9cNbHaIJHRV Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkiTAQAACgkQC3+MBN1Mb4jS5wCfbvLF0OXkWitxpSDRvVQWUGu+ GAkAnjtaKpiD8igNZOIaWNcc8OL2s5/3 =LdD8 -----END PGP SIGNATURE----- --NWFdL9cNbHaIJHRV--