1.5.12: ssh hangs with Windows XP SP2
Waiss, Garrett
GWaiss@netsuite.com
Wed Dec 8 23:47:00 GMT 2004
Cygwin version: 1.5.12
OS: Windows XP SP2
Before applying the SP2, ssh was working fine. Now ssh will hang with
this specfic case.
This works:
sh -c "ssh -i c:/keys/id_foo foo@bong 'ls -l /opt/'"
However, putting this into a java class for instance will cause this to
hang:
<code>
import java.io.*;
public class test {
public static void main(String[] args) {
try {
final String cmd = "/bin/ssh -p 22 -i
c:/keys/id_foo foo@bong 'ls -l /opt'";
final Process p = Runtime.getRuntime().exec(new
String[] {
"sh", "-c", cmd
});
final InputStreamReader isr = new
InputStreamReader(p.getInputStream());
final BufferedReader br = new
BufferedReader(isr);
String line;
final StringBuffer sb = new StringBuffer(0);
while((line = br.readLine()) != null) {
sb.append(line);
sb.append('\n');
}
System.out.println(sb.toString());
}
catch (Exception e) {
System.out.println(e.getMessage());
}
}
}
</code>
Is there a solution to this problem?
thx for your time.
Garrett Waiss
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cygcheck.out
Type: application/octet-stream
Size: 14815 bytes
Desc: cygcheck.out
URL: <http://cygwin.com/pipermail/cygwin/attachments/20041208/d6ee23a8/attachment.obj>
-------------- next part --------------
--
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple
Problem reports: http://cygwin.com/problems.html
Documentation: http://cygwin.com/docs.html
FAQ: http://cygwin.com/faq/
More information about the Cygwin
mailing list