我使用"com.hierynomus" % "sshj" % "0.13.0"
将文件从本地服务器传输到sftp服务器
文件正在转移没有任何问题,但我在控制台上收到以下错误:
[error] n.s.s.t.TransportImpl - Dying because - {}
net.schmizz.sshj.transport.TransportException: Broken transport; encountered EOF
at net.schmizz.sshj.transport.Reader.run(Reader.java:58) ~[sshj-0.13.0.jar:na]
代码:
val ssh = new SSHClient()
ssh.addHostKeyVerifier(new PromiscuousVerifier())
ssh.connect(props.host)
ssh.authPassword(props.username, props.password)
val client=ssh.newSFTPClient()
client.put(localDirectory + fileName, remoteDirectory)
请告诉我相同的原因