protected SshClient doCreateClient(SshConfiguration configuration) { SshClient client = new LibsshClient(configuration); client.init(this); return client; }
client.connect(username, hostname, port); client.authenticate(new SimplePasswordAuthenticator(password)); SshShell shell = client.createShell("dumb", 80, 24, 0, 0, null); client.disconnect();
client.connect(user, host, port); client.authenticate(new ConsolePasswordAuthenticator()); if (client.getProvider().getCapabilities().contains(Capability.PORT_FORWARD_EVENTS)) { client.addPortForwardListener(new SshPortForwardListener() { SshPortForward local = client.createLocalForward(null, 8900, "www.javassh.com", 80); local.open(); client.disconnect();
client.connect(user, host, port); System.out.println("Remote identification: " + client.getRemoteIdentification()); client.authenticate(new ConsolePasswordAuthenticator()); SshShell shell = client.createShell("dumb", 80, 24, 0, 0, null); client.disconnect(); if (client.getProvider().getCapabilities().contains(Capability.CHANNEL_DATA_EVENTS)) { System.out.println("Session over. Received " + dataTransferredIn + " bytes, sent " + dataTransferredOut + " bytes over the shell channel");
client.connect(user, host, port); client.authenticate(new SshAuthenticator[] { new ConsolePasswordAuthenticator(), new ConsoleKeyboardInteractiveAuthenticator() }); SftpClient sftp = client.createSftpClient(); sftp.open(); client.disconnect();
client.connect(user, host, port); client.authenticate(new ConsolePasswordAuthenticator()); SocketFactory sf = client.createTunneledSocketFactory(); client.disconnect();
client.connect(user, host, port); client.authenticate(new ConsolePasswordAuthenticator()); try { SshStreamChannel channel = client.createCommand("ls /etc"); channel.open(); try { client.disconnect();
client.connect(user, host, port); client.authenticate(new ConsolePasswordAuthenticator()); SshSCPClient sftp = client.createSCPClient(); sftp.open(); client.disconnect();
client.connect(user, host, port); client.authenticate(new ConsolePasswordAuthenticator()); SshPortForward remote = client.createRemoteForward(host, 8900, "www.javassh.com", 80); remote.open(); client.disconnect();
int port = ExampleUtilities.extractPort(connectionSpec); client.connect(user, host, port); client.authenticate(new ConsolePasswordAuthenticator()); System.out.println("Remote identification: " + client.getRemoteIdentification()); String cmd = ""; SshPublicKeySubsystem subsys = client.createPublicKeySubsystem(); subsys.open(); try {
client.connect(user, host, port); System.out.println("Remote identification: " + client.getRemoteIdentification()); client.authenticate(new ConsolePasswordAuthenticator()); client.addChannelHandler(new SshChannelHandler() {
password = new String(data.getData(UserAuthenticationData.PASSWORD)); con.connect(username, hostname, port); SshPasswordAuthenticator pwd = new SimplePasswordAuthenticator(password == null ? null : password.toCharArray()); if (!con.authenticate(pwd)) throw new FileSystemException("vfs.provider.sftp/authentication-failed.error", new Object[] { username });
protected void doCloseCommunicationLink() { try { if (sftp != null) { sftp.close(); sftp = null; } if (ssh != null) { ssh.disconnect(); ssh = null; } } catch (Exception ex) { // #ifdef DEBUG log.debug("Failed to close communication link.", ex); // #endif } }
this.sftp = null; } else { sftp = ssh.createSftpClient(); sftp.open(); home = sftp.getDefaultPath();
client.connect(user, host, port); client.authenticate(new ConsolePasswordAuthenticator()); if (client.getProvider().getCapabilities().contains(Capability.PORT_FORWARD_EVENTS)) { client.addPortForwardListener(new SshPortForwardListener() { SshPortForward local = client.createLocalForward(null, 8900, "www.javassh.com", 80); local.open(); System.out.println("Point your browser to http://localhost:8900."); SshShell shell = client.createShell("dumb", 80, 24, 0, 0, null); client.disconnect();
client.connect(user, host, port); DefaultGSSAuthenticator authenticator = new DefaultGSSAuthenticator(user); authenticator.setDebug(true); client.authenticate(authenticator); SshShell shell = client.createShell("dumb", 80, 24, 0, 0, null); client.disconnect();
protected SshClient doCreateClient(SshConfiguration configuration) { SshClient client = new GanymedSshClient(configuration, rng); client.init(this); return client; }
client.connect(user, host, port); client.authenticate(new ShellAuthenticator()); SshShell shell = client.createShell("dumb", 80, 24, 0, 0, null); try { shell.open(); client.disconnect();
public final SshClient createClient(SshConfiguration configuration) { doSupportsConfiguration(configuration); checkDefaultConfiguration(configuration); SshClient client = doCreateClient(configuration); client.init(this); return client; }
client.connect(user, host, port); client.authenticate(new ConsoleKeyboardInteractiveAuthenticator()); SshShell shell = client.createShell("dumb", 80, 24, 0, 0, null); try { shell.open(); client.disconnect();