tags:

views:

52

answers:

2

i want to connect a linux machine from my windows machine... with using java programmig.. i have putty,,,, can it help to me?????? and i have code""

Socket telnetClient=new Socket(inetAddress,23);
BufferedReader input=new BufferedReader(new InputStreamReader(System.in));
BufferedReader stdin=new BufferedReader(new InputStreamReader(telnetClient.getInputStream()));
PrintWriter out=new PrintWriter(telnetClient.getOutputStream());
System.out.println("connected");

can it work for linux......n i have ip address of that linux machine...

A: 

http://www.jcraft.com/jsch/ to connect to a ssh server. Thats just going to be a putty client in Java though... What you want to do is not clear though.

Doodle
A: 

Depending on what you're really trying to do, expectj might be worth investigating - it can connect to a remote host using telnet or ssh, invoke commands and wait for specific responses (in the spirit of the Unix expect command and its predecessors).

SimonJ