From owner-freebsd-questions Fri Jun 21 9:58:14 2002 Delivered-To: freebsd-questions@freebsd.org Received: from Danovitsch.dnsq.org (b74143.upc-b.chello.nl [212.83.74.143]) by hub.freebsd.org (Postfix) with ESMTP id 7C78B37B406 for ; Fri, 21 Jun 2002 09:58:03 -0700 (PDT) Received: from FreeBSD.Danovitsch.LAN (b83007.upc-b.chello.nl [212.83.83.7]) by Danovitsch.dnsq.org (8.11.3/8.11.3) with SMTP id g5LGuMO79114; Fri, 21 Jun 2002 18:56:22 +0200 (CEST) (envelope-from Danovitsch@Danovitsch.dnsq.org) Content-Type: text/plain; charset="iso-8859-1" From: "Daan Vreeken [PA4DAN]" Reply-To: Danovitsch@Danovitsch.dnsq.org To: Michael Grant Subject: Re: ssh/ftp only accounts Date: Fri, 21 Jun 2002 19:06:45 +0200 X-Mailer: KMail [version 1.2] References: <200206202017.g5KKHR814373@splat.grant.org> In-Reply-To: <200206202017.g5KKHR814373@splat.grant.org> Cc: FreeBSD-Questions@FreeBSD.org MIME-Version: 1.0 Message-Id: <02062119064501.00478@FreeBSD.Danovitsch.LAN> Content-Transfer-Encoding: 8bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On Thursday 20 June 2002 22:17, you wrote: > Can someone please tell me what the recommended way to set up an > account such that the user can only ftp and scp to a chrooted > directory? (i.e. no login shell). I don't know about scp, but I can tell you how I handle "ftp only" users... I created a group for all people who only need to have ftp-access to my machines (group: ftpusers). After that I created a fake shell something like this : ---- cut here #!/bin/sh echo "You are not allowed to login..." echo "bye now." ---- end (Put this script in /usr/local/bin/fakelogin or whereever) Then add this script to /etc/shells, since ftpd only allows users with a valid shell. Add users to the "ftpusers" group and give them the fakelogin shell. Now there's only one thing left to do : tell ftp to chroot when a ftpuser logs in. You can do this by simply adding "@ftpusers" on a line by itself (without the quotes) to the /etc/ftpchroot file. And here you go, all users in "ftpusers" are chroot-ed into their home-dirs when they log in. (Note this won't take your scp problems away, but it's a start) grtz, Daan -- Control the lights in my room: http://www.Danovitsch.dnsq.org/webcam Moo, ]:8) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message