Re: [JSch-users] Inserting password for the switch-user (su) command
Status: Alpha
Brought to you by:
ymnk
From: Chad K. <sun...@gm...> - 2012-03-14 16:11:48
|
Looks like channel.setPty(true) should do the trick. On Wed, Mar 14, 2012 at 12:01 PM, Chad Kellerman <sun...@gm...> wrote: > there is a ssh config option to force psuedo tty allocation. Add that to > your config for the ssh connection. > > > > On Wed, Mar 14, 2012 at 11:50 AM, Simone Battagliero < > s.b...@go...> wrote: > >> I tried, but it seems to be not supported in my OS... I have Red Hat >> 4.1.2-51 with 2.6.18 kernel. >> I also tried su -c "Command" < "/path/to/file" but it says "standard in >> must be a tty". >> Thank you >> >> Il giorno 14 marzo 2012 15:58, Chad Kellerman <sun...@gm...> ha >> scritto: >> >> 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.b...@go...> 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 >>>> JSc...@li... >>>> 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?" >>> >> >> > > > -- > 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?" > -- 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?" |