Maybe, instead of re-coding the telnet protocol, maybe it is easier to execute ssh (ssh is the encrypted version of telnet)
the good thing about ssh is that it can authenticate with PKI keys. so you don't have to specify a password. Placing the keys in the right directories is all you need to do. It's also a lot safer then telnet (everything, including the passwd is encrypted, bad news for sniffers...) then you just fire the command : ssh username@servername command_to_execute. This you can call easily from java using the System and Runtime classes, so you can even retrieve the return-code from it. more info: www.openssh.org Mike On Wed, 2002-09-04 at 07:57, Pramod Nair wrote: > The TELNET RFC should help you. You can get it here > http://www.rfc-editor.org/cgi-bin/rfcdoctype.pl?loc=RFC&letsgo=854&type=ftp& > file_format=txt > > > Pramod > > ----- Original Message ----- > From: "Prerna Sawhney (EHS)" <[EMAIL PROTECTED]> > To: <[EMAIL PROTECTED]> > Sent: Wednesday, September 04, 2002 12:01 PM > Subject: Telnet program > > > > Hi, > > > > I want to write a java program that will do a telnet to a remote machine > > and execute a script on the remote machine. > > Can anyone tell me a solution. > > > > I opened a socket at port 23 but I am lost as to what to do after that > > > > Thanks > > Prerna > > > > > ___________________________________________________________________________ > > To unsubscribe, send email to [EMAIL PROTECTED] and include in the > body > > of the message "signoff SERVLET-INTEREST". > > > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > > Resources: http://java.sun.com/products/servlet/external-resources.html > > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > > > > ___________________________________________________________________________ > To unsubscribe, send email to [EMAIL PROTECTED] and include in the body > of the message "signoff SERVLET-INTEREST". > > Archives: http://archives.java.sun.com/archives/servlet-interest.html > Resources: http://java.sun.com/products/servlet/external-resources.html > LISTSERV Help: http://www.lsoft.com/manuals/user/user.html > ___________________________________________________________________________ To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff SERVLET-INTEREST". Archives: http://archives.java.sun.com/archives/servlet-interest.html Resources: http://java.sun.com/products/servlet/external-resources.html LISTSERV Help: http://www.lsoft.com/manuals/user/user.html