Search in sources :

Example 1 with AuthorizedKeysAuthenticator

use of org.apache.sshd.server.config.keys.AuthorizedKeysAuthenticator in project winery by eclipse.

the class TestWithGitRepoAndSshServer method setUp.

protected static void setUp() throws IOException, URISyntaxException {
    sshd = SshServer.setUpDefaultServer();
    sshd.setHost("localhost");
    sshd.setPort(sshPort);
    sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(new File("host.ser").toPath()));
    sshd.setPublickeyAuthenticator(new AuthorizedKeysAuthenticator(Paths.get(Objects.requireNonNull(ClassLoader.getSystemClassLoader().getResource("authorized_keys")).toURI())));
    sshd.start();
}
Also used : SimpleGeneratorHostKeyProvider(org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider) AuthorizedKeysAuthenticator(org.apache.sshd.server.config.keys.AuthorizedKeysAuthenticator) File(java.io.File)

Aggregations

File (java.io.File)1 AuthorizedKeysAuthenticator (org.apache.sshd.server.config.keys.AuthorizedKeysAuthenticator)1 SimpleGeneratorHostKeyProvider (org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider)1