server.setShellFactory(new CRaSHCommandFactory(factory, encoding)); server.setCommandFactory(new SCPCommandFactory(context)); server.setKeyPairProvider(keyPairProvider);
protected void setShellFactory() { sshd.setShellFactory(new JASShellFactory(this, node())); }
public static SshServer setUpDefaultServer(final SshdConfigInterface configInterface) { SshServer sshd = SshServer.setUpDefaultServer(); sshd.setCommandFactory(new PrtgCommandFactory(configInterface)); sshd.setShellFactory(new PrtgShellFactory(configInterface)); return sshd; }
protected void activate(ComponentContext cc) throws IOException { port = (Integer) cc.getProperties().get(PORT); sshd.setPort(port); sshd.setShellFactory(new Factory<Command>() {
public void start() { sshServer = SshServer.setUpDefaultServer(); sshServer.setPort(port); sshServer.setHost("0.0.0.0"); final String basePath = new File(System.getProperty("user.dir")).getAbsolutePath(); if (SecurityUtils.isBouncyCastleRegistered()) { sshServer.setKeyPairProvider(new PEMGeneratorHostKeyProvider(new File(basePath, KEY_NAME + ".pem") .getPath())); } else { sshServer.setKeyPairProvider(new SimpleGeneratorHostKeyProvider(new File(basePath, KEY_NAME + ".ser") .getPath())); } sshServer.setShellFactory(new CrestComandsFactory(session, securityHandler)); sshServer.setPasswordAuthenticator(new PasswordAuthenticatorImpl(securityHandler)); try { sshServer.start(); } catch (IOException e) { e.printStackTrace(); } }
public SshServer(int port) { this.port = port; sshd = org.apache.sshd.SshServer.setUpDefaultServer(); sshd.setPort(port); sshd.setShellFactory(new SshShellFactory()); initialize(this.sshd); }
sshServer.setKeyPairProvider(new ResourceKeyPairProvider(new String[]{shellConfiguration.getString("key.location")})); sshServer.setShellFactory(new Factory<Command>() { @Override public Command create() {
sshServer.setKeyPairProvider(new ResourceKeyPairProvider(new String[]{shellConfiguration.getString("key.location")})); sshServer.setShellFactory(new Factory<Command>() { @Override public Command create() {
@Override public void initialize(int port) { Security.addProvider(new BouncyCastleProvider()); sshd = SshServer.setUpDefaultServer(); sshd.setPort(port); StreamKeyPairProvider fileKeyPairProvider = new StreamKeyPairProvider(); sshd.setKeyPairProvider(fileKeyPairProvider); SftpSubsystem.Factory factory = new SftpSubsystem.Factory(); sshd.setSubsystemFactories(Arrays.<NamedFactory<Command>>asList(factory)); sshd.setCommandFactory(new ScpCommandFactory()); sshd.setShellFactory(new ProcessShellFactory()); sshd.setPasswordAuthenticator(new MockPasswordAuthenticator()); }
.<NamedFactory<Command>> asList(new SftpSubsystem.Factory())); sshd.setCommandFactory(new ScpCommandFactory()); sshd.setShellFactory(new ProcessShellFactory(new String[] { "/system/bin/sh", "-i", "-l" })); // necessary if you want to type commands over ssh sshd.setPasswordAuthenticator(new PasswordAuthenticator() {
public void startSSHServer() { int port = 8888; SshServer sshd = SshServer.setUpDefaultServer(); sshd.setPort(port); sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider( "src/test/resources/hostkey.ser")); sshd.setSubsystemFactories(Arrays .<NamedFactory<Command>> asList(new SftpSubsystem.Factory())); sshd.setCommandFactory(new ScpCommandFactory()); sshd.setShellFactory(new ProcessShellFactory(new String[] { "/system/bin/sh", "-i", "-l" })); // necessary if you want to type commands over ssh sshd.setPasswordAuthenticator(new PasswordAuthenticator() { @Override public boolean authenticate(String u, String p, ServerSession s) { return ("sftptest".equals(u) && "sftptest".equals(p)); } }); try { sshd.start(); } catch (IOException e) { e.printStackTrace(); } }
sshd.setKeyPairProvider(new SimpleGeneratorHostKeyProvider("key.ser")); sshd.setShellFactory(new ProcessShellFactory(new String[] { "cmd.exe "}));
server.setShellFactory(new CRaSHCommandFactory(factory, encoding)); server.setCommandFactory(new SCPCommandFactory(context)); server.setKeyPairProvider(keyPairProvider);
server.setShellFactory(new CRaSHCommandFactory(handler)); server.setCommandFactory(new SCPCommandFactory(getContext())); server.setKeyPairProvider(new URLKeyPairProvider(key));
sshd.setShellFactory( processShellFactory );
sshd.setShellFactory( processShellFactory );