Date: Fri, 11 Aug 2000 00:16:20 +0100 From: Brian Somers <brian@Awfulhak.org> To: Brian Dean <brdean@unx.sas.com> Cc: Luoqi Chen <luoqi@watermarkgroup.com>, bde@zeta.org.au, freebsd-arch@FreeBSD.org, brian@Awfulhak.org Subject: Re: isatty() reports false results Message-ID: <200008102316.AAA29996@hak.lan.Awfulhak.org> In-Reply-To: Message from Brian Dean <brdean@unx.sas.com> of "Thu, 27 Jul 2000 19:27:26 EDT." <Pine.BSF.4.21.0007271911001.78156-100000@tribble.unx.sas.com>
next in thread | previous in thread | raw e-mail | index | archive | help
[.....] > % /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 <brian@Awfulhak.org> <brian@[uk.]FreeBSD.org> <http://www.Awfulhak.org> <brian@[uk.]OpenBSD.org> 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008102316.AAA29996>