public static Sftp Clone(SshBase baseConnection) { var clone = new Sftp(baseConnection.Host, baseConnection.Username, baseConnection.Password); clone.Session = baseConnection.Session; return clone; }
public static SshExec Clone(SshBase baseConnection) { var exec = new SshExec(baseConnection.Host, baseConnection.Username, baseConnection.Password); exec.Session = baseConnection.Session; return exec; }
public static SshExec Clone(SshBase baseConnection) { var exec = new SshExec(baseConnection.Host, baseConnection.Username, baseConnection.Password); exec.Session = baseConnection.Session; return(exec); }
public static Sftp Clone(SshBase baseConnection) { var clone = new Sftp(baseConnection.Host, baseConnection.Username, baseConnection.Password); clone.Session = baseConnection.Session; return(clone); }
protected void SetupSSH(SshBase ssh, NodeAuth auth) { if (auth.Type == NodeAuthType.Password) ssh.Password = auth.Secret; if (auth.Type == NodeAuthType.SSHKey) ssh.AddIdentityFile (auth.Secret); Exception error = null; for (int i = 0; i < MaxConnectionAttempts; i++) { try{ ssh.Connect (); return; } catch (Exception e) { Console.WriteLine ("Connection error: {0}", e); error = e; } Thread.Sleep (100); } if (error != null) throw error; }
private void SetupSSH(SshBase ssh, NodeAuth auth) { if (auth.Type == NodeAuthType.Password) ssh.Password = auth.Secret; }