Quantcast
Channel: sshnet Discussions Rss Feed
Viewing all articles
Browse latest Browse all 1729

New Post: Proxy issue with Sftp class (client) with Renci.SshNet library

$
0
0
This should do it:
using Renci.SshNet;

namespace SshNetTests
{
    class Program
    {
        public static void Main()
        {
            var privateKeyAuthenticationMethod = new PrivateKeyAuthenticationMethod("<user>",
                new PrivateKeyFile(@"<path to private key>"));
            var connectionInfo = new ConnectionInfo("<SSH server hostname or IP address>",
                                                    22,
                                                    "<user>",
                                                    ProxyTypes.Http,
                                                    "<proxy server hostname or IP address>",
                                                    8080,
                                                    "<proxy user>",
                                                    "<proxy password>",
                                                    privateKeyAuthenticationMethod);

            using (var sftpClient = new SftpClient(connectionInfo))
            {
                sftpClient.Connect();
            }
        }

    }
}

Viewing all articles
Browse latest Browse all 1729

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>