Open source Telnet Java API

2019-02-16 22:28发布

Is there an open source telnet API/library out there for Java (something like Python telnetlib)? I need to connect to a server using telnet and execute some commands from within a Java program.

标签: java telnet
3条回答
狗以群分
2楼-- · 2019-02-16 23:03

My preference is to use the Apache Commons-Net library. http://commons.apache.org/net/ It supports many client protocols, including Telnet.

I've used this in the past and it works quite well.

查看更多
ゆ 、 Hurt°
3楼-- · 2019-02-16 23:11

Sure is.

http://sourceforge.net/projects/jtelnet/ (EDIT: Noted as crap.)

Here is an Apache project which is presumably much more handy:

http://commons.apache.org/net/

查看更多
爷、活的狠高调
4楼-- · 2019-02-16 23:16

Maybe is worth considering using SSH protocol, instead of Telnet. Telnet is much less secure, for instance all the data is transmitted as plain text (including your passwords).

查看更多
登录 后发表回答