/// <summary> /// Gets a <see cref="SshClientWrapper"/> for which the Connect() method has NOT been called. /// </summary> public static SshClientWrapper GetUnconnectedSshClientWrapper(this AwsEc2ServerSecrets awsEc2ServerSecrets) { var connectionInfo = awsEc2ServerSecrets.GetConnectionInfo(); var clientWrapper = new SshClientWrapper(connectionInfo); return(clientWrapper); }
/// <summary> /// Gets a connected <see cref="SshClientWrapper"/>. /// </summary> public static SshClientWrapper GetConnectedSshClientWrapper(this AwsEc2ServerSecrets awsEc2ServerSecrets) { var clientWrapper = awsEc2ServerSecrets.GetUnconnectedSshClientWrapper(); clientWrapper.SshClient.Connect(); return(clientWrapper); }
public static ConnectionInfo GetConnectionInfo(this AwsEc2ServerSecrets awsEc2ServerSecrets) { var connectionInfo = Utilities.GetConnectionInfo( awsEc2ServerSecrets.HostUrl, awsEc2ServerSecrets.UserID, awsEc2ServerSecrets.Password, awsEc2ServerSecrets.PrivateKeyFilePath); return(connectionInfo); }
public static AwsEc2ServerSecrets GetAwsEc2ServerSecrets(this AwsEc2ServerSecretsSerialization serialization, string hostFriendlyName) { var hostConnectionDefinition = serialization.HostConnectionsByFriendlyName[hostFriendlyName]; var userAuthentication = serialization.UserAuthenticationsByFriendlyName[hostConnectionDefinition.UserAuthenticationName]; var serverSecrets = new AwsEc2ServerSecrets() { HostUrl = hostConnectionDefinition.HostURL, UserID = userAuthentication.UserID, Password = userAuthentication.Password, PrivateKeyFilePath = userAuthentication.PrivateKeyFilePath, }; return(serverSecrets); }
/// <summary> /// Gets a connected <see cref="SshClientWrapper"/>. /// </summary> public static SshClientWrapper GetSshClientWrapper(this AwsEc2ServerSecrets awsEc2ServerSecrets) { var output = awsEc2ServerSecrets.GetConnectedSshClientWrapper(); return(output); }