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

New Post: Run scp command from remote server via SSHClient

$
0
0
Example:
using (var client = new SshClient(Server1IP, 22, Server1Username, Server1Password)
{
  client.Connect(); // Connection Desktop-Machine to Server1

  var port1 = new ForwardedPortLocal("localhost", 2222, Server2IP, 22); // Forward the SSH-Port of Server2 via Server1 on the Desktop-Machine
  client.AddForwardedPort(port1);
  port1.Start();
  // Do your stuff, Open SSH/SCP/SFTP
  var client2 = new  SshClient("localhost", 2222, Server2Username, Server2Password);
  client2.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>