Try:

*su -c "Command" < "Password"

That may work depending on the remote host OS and su version.  I've used it
with recent versions of Linux.
*


On Wed, Mar 14, 2012 at 10:43 AM, Simone Battagliero <
s.battagli...@googlemail.com> wrote:

> Hi,
> I'm using JSch to login into a remote shell and execute commands in it,
> and I have no general problems. However, when I try to execute the "su"
> command, I see the password prompt "Password: " in the standard output, but
> I can't figure out how to insert that password with JSch. Apparently, no
> method of the interfaces UserInfo and UIKeyboardInteractive is called after
> the prompt. Perhaps particular settings are required... can somebody help
> me?
> Thanks,
>
> Simone
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> JSch-users mailing list
> JSch-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jsch-users
>
>


-- 
A grasshopper walks into a bar and the bartender says "Hey, we have a drink
named after you." And the grasshopper says "Really, You have a drink named
Murray?"
------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
JSch-users mailing list
JSch-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jsch-users

Reply via email to