标签:public channel stat int edr read word config row
import java.io.BufferedReader;import com.jcraft.jsch.Channel;
import com.jcraft.jsch.ChannelExec;
import com.jcraft.jsch.JSch;
import com.jcraft.jsch.JSchException;
import com.jcraft.jsch.Session;
/**
*/
public class JSchUtil {
private static JSch jsch;
private static Session session;
/**
@throws JSchException
*/
public static void connect(String user, String passwd, String host) throws JSchException {
jsch = new JSch();
session = jsch.getSession(user, host, 22);
session.setPassword(passwd);
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
session.setConfig(config);
session.connect();
}
/**
}
标签:public channel stat int edr read word config row
原文地址:https://blog.51cto.com/6272379/2420784