0

I'm trying to use RenciSshNet in my .NET Framework 4.8 Console Project.

I need to connect to a remote device via a Bastion/Jump server to issue commands and read the results.

The bastion server requires a privake key.

I can do this via the ssh command line by adding the bastion server settings in ~/.ssh/config file then using the following on the command line :-

ssh -J bastion user@hostip

and I just enter the password for the remote device.

I'm trying to do this in c# and include the remote device password so it just connects and allows me to enter commands etc.

I just can't work out if this is supported (i.e. the equivalent of the -J option).

I can connect to the bastion server using the following code

PrivateKeyFile pkFile = new PrivateKeyFile("Path to bastion ppk file for private key");
PrivateKeyConnectionInfo ci = new PrivateKeyConnectionInfo("ipaddress", port, "username", pkFile);
SshClient client = new SshClient(ci);

Is there a way I can get RenciSshNet to create the onward connection ? Thanks.

Dugggie
  • 356
  • 5
  • 17

0 Answers0