public static void main(String[] args) {
SshClient client = new SshClient();
try {
ConsoleKnownHostsKeyVerification console = new ConsoleKnownHostsKeyVerification();
client.connect("192.168.13.51", 22);//IP和端口
//设置用户名和密码
PasswordAuthenticationClient pwd = new PasswordAuthenticationClient();
pwd.setUsername("root");
pwd.setPassword("passw0rd");
int result = client.authenticate(pwd);
BASE64Encoder encoder = new BASE64Encoder();
if (result == AuthenticationProtocolState.COMPLETE) {//如果连接完成
SftpClient sftp = client.openSftpClient();
List list = sftp.ls("/root");
for (SftpFile f : list) {
if (f.getFilename().equalsIgnoreCase("A16669F409774609BEB_144000820000_10012562.pdf")) {
String name = f.getFilename()