From owner-freebsd-arch Thu Aug 10 16:20: 5 2000 Delivered-To: freebsd-arch@freebsd.org Received: from Awfulhak.org (tun.AwfulHak.org [194.242.139.173]) by hub.freebsd.org (Postfix) with ESMTP id E437937BD54 for ; Thu, 10 Aug 2000 16:19:55 -0700 (PDT) (envelope-from brian@Awfulhak.org) Received: from hak.lan.Awfulhak.org (root@hak.lan.awfulhak.org [172.16.0.12]) by Awfulhak.org (8.9.3/8.9.3) with ESMTP id AAA50805; Fri, 11 Aug 2000 00:16:23 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Received: from hak.lan.Awfulhak.org (brian@localhost [127.0.0.1]) by hak.lan.Awfulhak.org (8.9.3/8.9.3) with ESMTP id AAA29996; Fri, 11 Aug 2000 00:16:20 +0100 (BST) (envelope-from brian@hak.lan.Awfulhak.org) Message-Id: <200008102316.AAA29996@hak.lan.Awfulhak.org> X-Mailer: exmh version 2.1.1 10/15/1999 To: Brian Dean Cc: Luoqi Chen , bde@zeta.org.au, freebsd-arch@FreeBSD.org, brian@Awfulhak.org Subject: Re: isatty() reports false results In-Reply-To: Message from Brian Dean of "Thu, 27 Jul 2000 19:27:26 EDT." Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Fri, 11 Aug 2000 00:16:20 +0100 From: Brian Somers Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG [.....] > % /usr/local/bin/pty-redir \ > /usr/bin/ssh -t -e none -o 'Batchmode yes' \ > -i $key -l $user $host > ~/vpndev > % /usr/sbin/pppd `cat ~/vpndev` $localip:$remoteip > > In the above, pty-redir allocates a pty, opens the master side of it, > prints out the name of the slave side, dup2()'s the master side as > stdin and stdout, forks off ssh, then exits. This leaves ssh using > the master side as stdin/stdout. On the remote host, the login shell > for $user is just /usr/sbin/pppd. > > The local invocation of pppd uses the slave side of the pty which > talks to the remote side and establishes the connection. > > [This, btw, shows some of the true elegance of Unix - the ability to > chain together several seemingly unrelated processes in order > instantiate a construct that the original authors of the individual > pieces did not necesarily intend or conceive.] [.....] > The only problem is that, if we don't change either 'isatty()', or > 'ssh', or the pty driver, then others are going to run into this same > problem if, like me, they come across the Linux VPN HOW-TO and use it > for ideas in setting up a VPN on FreeBSD :(. Our pty driver seems to > behave differently in this respect to Linux and NetBSD (and probably > others as well). IMHO pppd's mucking about with ptys is evil. This whole thing is much easier to do from ppp(8), by simply using ``set device "!ssh blah ppp -direct label"'', you get ppp interacting with ssh via a socketpair(). Having said that, can't pppd do it by just using ``ssh -t blah'' ? > -Brian -- Brian Don't _EVER_ lose your sense of humour ! To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message