client.start();
/** * * @param authenticationHandler * @param sshClient started SshClient * @throws IOException */ public AsyncSshHandler(final AuthenticationHandler authenticationHandler, final SshClient sshClient) throws IOException { this.authenticationHandler = Preconditions.checkNotNull(authenticationHandler); this.sshClient = Preconditions.checkNotNull(sshClient); // Start just in case sshClient.start(); }
private SshClient getSshClient(BlueprintContainer blueprintContainer, String clientId) { // Create the client from prototype SshClient client = (SshClient) blueprintContainer.getComponentInstance(clientId); log.debug("Created client: {}", client); client.start(); return client; }
protected SshClient createClient() { // must create a new client for each usage SshClient client = SshClient.setUpDefaultClient(); client.setAgentFactory(agentFactory); // must start client client.start(); log.trace("Created SshClient: {}", client); return client; }
try { client = SshClient.setUpDefaultClient(); client.start(); int retries = 0; ClientSession session = null;
try { client = SshClient.setUpDefaultClient(); client.start(); ConnectFuture future = client.connect(host, Integer.parseInt(port)); ClientSession session = future.await().getSession();
@Override protected void connectInternal() throws Exception { log.info("Connecting to server {}:{}", configuration.getHost(), configuration.getPort()); client = SshClient.setUpDefaultClient(); setupAgent(configuration.getUsername(), configuration.getKeyFile(), client); client.start(); connect(client); if (configuration.getPassword() != null) { session.addPasswordIdentity(configuration.getPassword()); } session.auth().verify(); }
public void connect() { sshClient = SshClient.setUpDefaultClient(); sshClient.start(); try { clientSession =
private static void doWithScp(String user, String ip, int port, String pemPath, DoWithScpAction doWithScpAction) throws IOException, InterruptedException { SshClient client = SshClient.setUpDefaultClient(); ClientSession session = null; try { client.start(); session = connect(client, user, loadKeyPair(pemPath), ip, port); ScpClient scpClient = session.createScpClient(); doWithScpAction.doScpAction(scpClient); } finally { if (session != null) { session.close(true); } client.close(true); } }
loginButton.setClickShortcut(KeyCode.ENTER); client = SshClient.setUpDefaultClient(); client.start(); loginButton.addClickListener(this); GridLayout grid = new GridLayout(2,2);