Beispiel #1
0
        protected override jsch::Session ConnectImpl()
        {
            if (this.gwchain.Count == 0)
            {
                return(null);
            }
            // register identities
            this.m_jsch = new jsch::JSch();
            foreach (SshUserData user in gwchain)
            {
                if (user.useIdentityFile && user.idtt != "")
                {
                    m_jsch.addIdentity(user.idtt, user.psph);
                }
            }

            // logins
            jsch::Session gwsess = null;

            foreach (SshUserData user in gwchain)
            {
                gwsess = create_session(user, gwsess);
            }

            return(gwsess);
        }