我正在连接到远程服务器SSH服务器并尝试获取特定路径中的文件列表我能够获取路径中的文件列表但是它们处于不可读的格式可能对此有任何帮助
String host="xxxxx.yyyy.com";
String user="user";
String password="password";
String command1="dzdo su - lucy";
try{
java.util.Properties config = new java.util.Properties();
config.put("StrictHostKeyChecking", "no");
JSch jsch = new JSch();
Session session=jsch.getSession(user, host, 22);
session.setPassword(password);
session.setConfig(config);
session.connect();
System.out.println("Connected");
Channel channel=session.openChannel("shell");
OutputStream ops = channel.getOutputStream();
PrintStream ps = new PrintStream(ops, true);
channel.connect();
ps.println(command1);
ps.println("ls -ltr");