public class JschUtil extends Object
Constructor and Description |
---|
JschUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
close(com.jcraft.jsch.Channel channel)
关闭会话通道
|
static void |
close(com.jcraft.jsch.Session session)
关闭SSH连接会话
|
static com.jcraft.jsch.Channel |
createChannel(com.jcraft.jsch.Session session,
ChannelType channelType,
long timeout)
创建Channel连接
|
static com.jcraft.jsch.Channel |
openChannel(com.jcraft.jsch.Session session,
ChannelType channelType,
long timeout)
打开Channel连接
|
static com.jcraft.jsch.Session |
openSession(Connector connector)
打开Session会话
|
public static com.jcraft.jsch.Session openSession(Connector connector)
connector
- 连接信息JschSession
public static com.jcraft.jsch.Channel openChannel(com.jcraft.jsch.Session session, ChannelType channelType, long timeout)
session
- Session会话channelType
- 通道类型,可以是shell或sftp等,见ChannelType
timeout
- 连接超时时长,单位毫秒Channel
public static com.jcraft.jsch.Channel createChannel(com.jcraft.jsch.Session session, ChannelType channelType, long timeout)
session
- Session会话channelType
- 通道类型,可以是shell或sftp等,见ChannelType
timeout
- session超时时常,单位:毫秒Channel
public static void close(com.jcraft.jsch.Session session)
session
- SSH会话public static void close(com.jcraft.jsch.Channel channel)
channel
- 会话通道Copyright © 2025. All rights reserved.