use of org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory in project spring-integration by spring-projects.
the class SftpTestSupport method createServer.
@BeforeClass
public static void createServer() throws Exception {
server = SshServer.setUpDefaultServer();
server.setPasswordAuthenticator((username, password, session) -> true);
server.setPort(0);
server.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(new File("hostkey.ser")));
server.setSubsystemFactories(Collections.<NamedFactory<Command>>singletonList(new SftpSubsystemFactory()));
server.setFileSystemFactory(new VirtualFileSystemFactory(remoteTemporaryFolder.getRoot().toPath()));
server.start();
port = server.getPort();
}
use of org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory in project wildfly-camel by wildfly-extras.
the class EmbeddedSSHServer method setupSftp.
public void setupSftp() {
this.sshServer.setCommandFactory(new ScpCommandFactory());
this.sshServer.setSubsystemFactories(Arrays.asList(new SftpSubsystemFactory()));
}
use of org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory in project structr by structr.
the class SSHService method getSubsystems.
// ----- private methods -----
private List<NamedFactory<org.apache.sshd.server.Command>> getSubsystems() {
final List<NamedFactory<org.apache.sshd.server.Command>> list = new LinkedList<>();
// sftp
final SftpSubsystemFactory factory = new SftpSubsystemFactory();
list.add(factory);
factory.addSftpEventListener(this);
return list;
}
use of org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory in project AmazeFileManager by TeamAmaze.
the class AbstractSftpServerTest method createSshServer.
protected final int createSshServer(FileSystemFactory fileSystemFactory, int startPort) throws IOException {
server = SshServer.setUpDefaultServer();
server.setFileSystemFactory(fileSystemFactory);
server.setPublickeyAuthenticator(AcceptAllPublickeyAuthenticator.INSTANCE);
server.setHost("127.0.0.1");
server.setKeyPairProvider(hostKeyProvider);
server.setCommandFactory(new ScpCommandFactory());
server.setSubsystemFactories(Arrays.asList(new SftpSubsystemFactory()));
server.setPasswordAuthenticator(((username, password, session) -> username.equals("testuser") && password.equals("testpassword")));
try {
server.setPort(startPort);
server.start();
return startPort;
} catch (BindException ifPortIsUnavailable) {
return createSshServer(fileSystemFactory, startPort + 1);
}
}
Aggregations