org.kuali.common.util.secure
Class SSHUtils

java.lang.Object
  extended by org.kuali.common.util.secure.SSHUtils

public class SSHUtils
extends Object


Field Summary
static File DEFAULT_CONFIG_FILE
           
static File DEFAULT_KNOWN_HOSTS
           
static int DEFAULT_PORT
           
static String NO
           
static List<String> PRIVATE_KEY_DEFAULTS
           
static String STRICT_HOST_KEY_CHECKING
           
 
Constructor Summary
SSHUtils()
           
 
Method Summary
static void addConfigFile(List<String> args, File configFile, File defaultConfigFile)
           
static void addIdentityFile(List<String> args, File identityFile)
           
static void addOptions(List<String> args, Properties options)
           
static void addPort(List<String> args, String portOption, int port, int defaultPort)
           
static Properties getDefaultOptions()
           
static List<File> getDefaultPrivateKeys()
          Return a non-null list containing any private keys found by examining default private key locations in ~/.ssh and parsing ~/.ssh/config.
static List<File> getExistingAndReadable(List<String> filenames)
           
static List<String> getFilenames(File config)
           
static List<String> getFilenames(List<String> identityFileLines)
           
static List<String> getIdentityFileLines(List<String> lines)
           
static List<File> getPrivateKeys(File config)
          Return a non-null list containing any private keys found by examining default private key locations in ~/.ssh and parsing config.
static boolean isValidPort(int port)
          Return true if port >= 1 and port <= 65535, false otherwise.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRICT_HOST_KEY_CHECKING

public static final String STRICT_HOST_KEY_CHECKING
See Also:
Constant Field Values

NO

public static final String NO
See Also:
Constant Field Values

PRIVATE_KEY_DEFAULTS

public static final List<String> PRIVATE_KEY_DEFAULTS

DEFAULT_CONFIG_FILE

public static final File DEFAULT_CONFIG_FILE

DEFAULT_PORT

public static final int DEFAULT_PORT
See Also:
Constant Field Values

DEFAULT_KNOWN_HOSTS

public static final File DEFAULT_KNOWN_HOSTS
Constructor Detail

SSHUtils

public SSHUtils()
Method Detail

isValidPort

public static final boolean isValidPort(int port)
Return true if port >= 1 and port <= 65535, false otherwise.


addPort

public static final void addPort(List<String> args,
                                 String portOption,
                                 int port,
                                 int defaultPort)

addOptions

public static final void addOptions(List<String> args,
                                    Properties options)

addConfigFile

public static final void addConfigFile(List<String> args,
                                       File configFile,
                                       File defaultConfigFile)

addIdentityFile

public static final void addIdentityFile(List<String> args,
                                         File identityFile)

getPrivateKeys

public static final List<File> getPrivateKeys(File config)
Return a non-null list containing any private keys found by examining default private key locations in ~/.ssh and parsing config. Any files returned by this method are guaranteed to exist and be readable.


getDefaultPrivateKeys

public static final List<File> getDefaultPrivateKeys()
Return a non-null list containing any private keys found by examining default private key locations in ~/.ssh and parsing ~/.ssh/config. Any files returned by this method are guaranteed to exist and be readable.


getDefaultOptions

public static final Properties getDefaultOptions()

getExistingAndReadable

public static final List<File> getExistingAndReadable(List<String> filenames)

getFilenames

public static final List<String> getFilenames(File config)

getIdentityFileLines

public static final List<String> getIdentityFileLines(List<String> lines)

getFilenames

public static final List<String> getFilenames(List<String> identityFileLines)


Copyright © 2010-2013 The Kuali Foundation. All Rights Reserved.