From owner-freebsd-questions Thu Nov 16 6:31:10 2000 Delivered-To: freebsd-questions@freebsd.org Received: from femail2.sdc1.sfba.home.com (femail2.sdc1.sfba.home.com [24.0.95.82]) by hub.freebsd.org (Postfix) with ESMTP id 849D637B4D7 for ; Thu, 16 Nov 2000 06:31:07 -0800 (PST) Received: from cx443070b ([24.0.36.170]) by femail2.sdc1.sfba.home.com (InterMail vM.4.01.03.00 201-229-121) with SMTP id <20001116143055.WYMT19780.femail2.sdc1.sfba.home.com@cx443070b>; Thu, 16 Nov 2000 06:30:55 -0800 Message-ID: <004c01c04fda$2b1560a0$aa240018@cx443070b> From: "Jeremiah Gowdy" To: "Lloyd Rennie" , References: Subject: Re: chrooted shell accounts Date: Thu, 16 Nov 2000 06:33:20 -0800 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 5.50.4133.2400 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG ----- Original Message ----- From: "Lloyd Rennie" To: Sent: Monday, November 13, 2000 5:22 AM Subject: chrooted shell accounts > > I have been having difficulty chrooting a user's shell on a machine here, > as detailed below. In this case the user in question is 'derek'. > > > > derek's shell is /usr/local/bin/derekshell, which is a binary file > generated by /usr/local/bin/derekshell.c; > > void main (int argc, char *argv []) { > system("/usr/local/bin/derekshell.sh"); > } > > No rocket Science there. /usr/local/bin/derekshell has been added to > /etc/shells. > > /usr/local/bin/derekshell.sh looks like; > > #!/bin/sh > cd /home/derek > id # debug purposes > /usr/sbin/chroot /home/derek /bin/csh > id # debug purposes > I believe what you're doing wrong is, when you chroot, you need a new copy of the shell relative to the new path. In other words, when you chroot, suddenly /bin/csh is no longer valid. create /home/derek/bin/csh and you will probably have more luck. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message