Beispiel #1
0
        public static Sftp Clone(SshBase baseConnection)
        {
            var clone = new Sftp(baseConnection.Host, baseConnection.Username, baseConnection.Password);
            clone.Session = baseConnection.Session;

            return clone;
        }
Beispiel #2
0
        public static SshExec Clone(SshBase baseConnection)
        {
            var exec = new SshExec(baseConnection.Host, baseConnection.Username, baseConnection.Password);
            exec.Session = baseConnection.Session;

            return exec;
        }
Beispiel #3
0
        public static SshExec Clone(SshBase baseConnection)
        {
            var exec = new SshExec(baseConnection.Host, baseConnection.Username, baseConnection.Password);

            exec.Session = baseConnection.Session;

            return(exec);
        }
Beispiel #4
0
        public static Sftp Clone(SshBase baseConnection)
        {
            var clone = new Sftp(baseConnection.Host, baseConnection.Username, baseConnection.Password);

            clone.Session = baseConnection.Session;

            return(clone);
        }
Beispiel #5
0
        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;
        }
Beispiel #6
0
 private void SetupSSH(SshBase ssh, NodeAuth auth)
 {
     if (auth.Type == NodeAuthType.Password)
         ssh.Password = auth.Secret;
 }