Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.ruby
Net::SSH - how to respond to a prompt before first command?
Slawek Zachcial
7/10/2008 12:16:00 PM
Hello,
I'm trying to connect, using SSH, to a server that immediately after
login executes a script that requires input from user. The script is
asking the user to select the target username that the shell should
switch to. I'm using WinXP to run the script, the target server is
running HP-UX and the user is switched using 'pbrun' command.
Here is the code I used to connect and then execute the "date" command:
Net::SSH.start(myhost, myuser, :password => mypassword, :keys => mykeys,
:passphrase => mypassphrase, :verbose => :debug) do |ssh|
puts ' ######', ' #', ' # ' + ssh.exec!("date"), ' #', ' ######'
end
When I run this script connecting to another host which does not require
the user input immediately after login everything works fine. That's why
I suspect that the user input part is causing the problem.
I attached the logs generated by the script for the "Working Scenario"
and "Not Working Scenario".
When I execute the script connecting to the server where it does not
work, the script basically hangs.
I tried all kind of things with channels, I also looked through this
forum and generally on the web. No luck. I admit that I'm a Ruby newbie
so I may be missing something obvious here.
Any help would be greatly appreciated.
Thanks,
/Slawek
Attachments:
http://www.ruby-...
attachment/2356/...
--
Posted via
http://www.ruby-...
.
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Net::SSH - how to respond to a prompt before first command?
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password