This commit is contained in:
Looly 2022-05-18 10:38:40 +08:00
parent 858be6aafa
commit 586b8d2c85

View File

@ -25,7 +25,7 @@ import java.util.List;
* *
* <p> * <p>
* 基于sshj 框架适配<br> * 基于sshj 框架适配<br>
* 参考https://github.com/hierynomus/sshj * 参考<a href="https://github.com/hierynomus/sshj">https://github.com/hierynomus/sshj</a>
* </p> * </p>
* *
* @author youyongkun * @author youyongkun
@ -102,7 +102,7 @@ public class SshjSftp extends AbstractFtp {
this.ssh = new SSHClient(); this.ssh = new SSHClient();
ssh.addHostKeyVerifier(new PromiscuousVerifier()); ssh.addHostKeyVerifier(new PromiscuousVerifier());
try { try {
ssh.connect(ftpConfig.getHost()); ssh.connect(ftpConfig.getHost(), ftpConfig.getPort());
ssh.authPassword(ftpConfig.getUser(), ftpConfig.getPassword()); ssh.authPassword(ftpConfig.getUser(), ftpConfig.getPassword());
ssh.setRemoteCharset(ftpConfig.getCharset()); ssh.setRemoteCharset(ftpConfig.getCharset());
this.sftp = ssh.newSFTPClient(); this.sftp = ssh.newSFTPClient();