Re: [JSch-users] Doc and command su

2010-04-28 Thread Vivien Duparc
Thanks a lot, I try that tomorrow. Le 28 avr. 2010 à 18:01, Keith Alan Richardson a écrit : > Here is example code. Tested against Linux run OpenSSH. > > @ Ehud, I wasn't able to get it to work with openChannel("session"). > Any ideas why? > > > > import java.io.InputStream; > import java.io.

Re: [JSch-users] Doc and command su

2010-04-28 Thread Stephen Williams
Perhaps you need to set pty? As in: ((ChannelShell) channel).setPtyType("dumb"); --Steve On 4/28/2010 9:01 AM, Keith Alan Richardson wrote: > Here is example code. Tested against Linux run OpenSSH. > > @ Ehud, I wasn't able to get it to work with openChannel("session"). > Any ideas why? > >

Re: [JSch-users] Doc and command su

2010-04-28 Thread Keith Alan Richardson
Here is example code.  Tested against Linux run OpenSSH. @ Ehud, I wasn't able to get it to work with openChannel("session"). Any ideas why? import java.io.InputStream; import java.io.PipedInputStream; import java.io.PipedOutputStream; import com.jcraft.jsch.Channel; import com.jcraft.jsch.JSc

Re: [JSch-users] Doc and command su

2010-04-27 Thread Vivien Duparc
Is there no way to connect remote host with a user and when connected made a 'su - user2' command (command that need to give a password) without asking anything to the application user ? I begin to believe it's impossible. Thanks for your help. Le 24 avr. 2010 à 01:47, Keith Alan Richards

Re: [JSch-users] Doc and command su

2010-04-24 Thread Ehud Kaldor
use 'session' instead of 'exec', parse the response and send the password after. Ehud On Sat, Apr 24, 2010 at 1:31 AM, Vivien Duparc wrote: > Thanks for your answer but My problem is not how to execute a command, > this i understand, but how execute a 'su - user' command where remote host > ask

Re: [JSch-users] Doc and command su

2010-04-24 Thread Vivien Duparc
Thanks for your answer but My problem is not how to execute a command, this i understand, but how execute a 'su - user' command where remote host ask for user's password and so how send remote host this password. Le 24 avr. 2010 à 01:47, Keith Alan Richardson a écrit : There is no docu

Re: [JSch-users] Doc and command su

2010-04-23 Thread Keith Alan Richardson
There is no documentation. Look at the examples directory For running commands remotely, even su, look at Exec.java in the examples directory On Apr 23, 2010 2:41 PM, "Vivien Duparc" wrote: Hi, I'm a new user of api jsch and i have two question please First, is There any doc anywhere ? Or t

[JSch-users] Doc and command su

2010-04-23 Thread Vivien Duparc
Hi, I'm a new user of api jsch and i have two question please First, is There any doc anywhere ? Or the only help for beginner are examples ? Second, do you know how to execute an su command please ? Thx. --