Search in sources :

Example 21 with SimpleGeneratorHostKeyProvider

use of org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider 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

SimpleGeneratorHostKeyProvider (org.apache.sshd.server.keyprovider.SimpleGeneratorHostKeyProvider)21 File (java.io.File)13 Command (org.apache.sshd.server.Command)9 SftpSubsystemFactory (org.apache.sshd.server.subsystem.sftp.SftpSubsystemFactory)7 VirtualFileSystemFactory (org.apache.sshd.common.file.virtualfs.VirtualFileSystemFactory)5 ArrayList (java.util.ArrayList)4 NamedFactory (org.apache.sshd.common.NamedFactory)4 FileInputStream (java.io.FileInputStream)3 FileOutputStream (java.io.FileOutputStream)3 IOException (java.io.IOException)3 SshServer (org.apache.sshd.server.SshServer)3 ScpCommandFactory (org.apache.sshd.server.scp.ScpCommandFactory)3 Before (org.junit.Before)3 LsEntry (com.jcraft.jsch.ChannelSftp.LsEntry)2 PublicKey (java.security.PublicKey)2 CommandFactory (org.apache.sshd.server.CommandFactory)2 PasswordAuthenticator (org.apache.sshd.server.PasswordAuthenticator)2 UserAuthPassword (org.apache.sshd.server.auth.UserAuthPassword)2 ScpCommandFactory (org.apache.sshd.server.command.ScpCommandFactory)2 ServerSession (org.apache.sshd.server.session.ServerSession)2