Re: Change from one user to another in program.

From: Barry Margolin (barry.margolin_at_level3.com)
Date: 05/30/03


Date: Fri, 30 May 2003 21:46:02 GMT

In article <6c2fdba7.0305301315.5f893218@posting.google.com>,
Greg Ennis <PoMec@PoMec.Net> wrote:
>>
>> Running su through a pty should work -- a pty is considered a "genuine
>> terminal" (if it weren't, you wouldn't be able to use su in an xterm or
>> remote login session).
>
>I have the same need. Could you elaborate on using pty. I do not
>understand what you are doing.

A pty is a pseudo-terminal, a software construct that's a cross between a
pipe and a terminal. The process that opens the slave end of the pty views
it as a terminal, so applications like su that read their input from the
controlling terminal rather than standard input will work.

The easiest way to make use of a pty is by using the Expect scripting
language.

-- 
Barry Margolin, barry.margolin@level3.com
Level(3), Woburn, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.