当前位置:网站首页>JSCH 简单使用
JSCH 简单使用
2022-08-05 13:49:00 【monkeySix】
channel = (ChannelShell) session.openChannel("shell");
// 连接资源
channel.connect();
input = new BufferedReader(new InputStreamReader(channel.getInputStream()));
// writer 输入命令到服务器 进行执行
printWriter = new PrintWriter(channel.getOutputStream());
printWriter.println(command);
printWriter.println("exit");
printWriter.flush();
log.info("The remote command is: ");
String line;
// 获取命令执行的结果
while ((line = input.readLine()) != null) {
stdout.add(line);
System.out.println(line);
}边栏推荐
猜你喜欢
随机推荐
基于PCA模型的首个投资组合表现跟进(截止至2022.7.22)
深度学习之 11 空洞卷积的实现
Kernel implementation of buddy allocator
2022-08-04 Brighthouse: An Analytic DataWarehouse for Ad-hoc Queries
[vulhub]PostGresql远程代码执行漏洞复现(CVE-2018-1058)
Horizon First Experience. Part 1
2022-08-04 Brighthouse: An Analytic DataWarehouse for Ad-hoc Queries
Subnet Mask and Subnetting
Stack和Queue 栈和队列
dedecms织梦后台添加图集提示附加表时出错
双因子与多因子身份验证有什么区别?
R语言计算时间序列数据的差分值:使用diff函数计算时间序列数据的差分值、自定义设置lag参数指定差分间距的大小(例如计算某指标年同比变化量、设置lag参数为12)
期货开户欲善其事先利其器
DonkeyCar源码阅读.4(项目文件创建)
ipv4: inet初始化过程
学习笔记61—兴趣阅读之经济学
五、平衡二叉树——伸展树Splay
为什么鲜有炫富的程序员?
SQL中COUNT和SUM
十分钟教会你如何使用VitePress搭建及部署个人博客站点









