Description
"OpenSSH for Windows" version
8.0.0.0
Server OperatingSystem
Windows Server 2012 R2 Datacenter
Client OperatingSystem
WIN 10
What is failing
use sshj execute command:
DefaultConfig defaultConfig = new DefaultConfig(); SSHClient sshClient = new SSHClient(defaultConfig); sshClient.addHostKeyVerifier(new PromiscuousVerifier()); sshClient.connect(authModel.getHost(), authModel.getPort()); sshClient.authPassword(authModel.getUsername(), authModel.getPassword()); sshClient.setTimeout(15000); try (Session session = sshClient.startSession()) { Session.Command instance = session.exec(command); String result = IOUtils.readFully(instance.getInputStream()).toString(StandardCharsets.ISO_8859_1.name()); result = result + IOUtils.readFully(instance.getErrorStream()).toString(StandardCharsets.ISO_8859_1.name()); textPane.insertMessage(result); }
Expected output
list directory
Actual output
hold
errors****
Server network environment is intranet,when i check server eventviewer openssh log,found only one recode :
sshd: Accepted password for Administrator from 127.0.0.1 port 27656 ssh2
not found Received disconnect info
why sshd accetped password from 127.0.0.1?
i think this is the key to hold