router

Providing input/subcommands to command executed over SSH with JSch

别等时光非礼了梦想. 提交于 2019-11-26 04:28:19
问题 I\'m trying to manage router via Java application using Jcraft Jsch library. I\'m trying to send Router Config via TFTP server. The problem is in my Java code because this works with PuTTY. This my Java code: int port=22; String name =\"R1\"; String ip =\"192.168.18.100\"; String password =\"root\"; JSch jsch = new JSch(); Session session = jsch.getSession(name, ip, port); session.setPassword(password); session.setConfig(\"StrictHostKeyChecking\", \"no\"); System.out.println(\"Establishing