I am traying to access Oracle Linux Server 7 via SSH and connecting successfully. Whenever want to get all enviroment variables via powershell its work fine , but i am getting fewer enviroment variables when i use SSH.NET (.NET SSH Library)
Here is my code
static void Main(string[] args)
{
var host = $"host";
var user = "username";
var pwd = "password";
ConnectionInfo ConnNfo = new ConnectionInfo(host, 22, user,
new AuthenticationMethod[]{
// Pasword based Authentication
new PasswordAuthenticationMethod(user,pwd),
new PrivateKeyAuthenticationMethod("rsa.key"),
}
);
using (var sshclient = new SshClient(ConnNfo))
{
sshclient.Connect();
if (sshclient.IsConnected)
{
RunCommand(sshclient, "printenv");
sshclient.Disconnect();
}
}
Console.ReadKey();
}
I was tried some solutions in this question but i didn't get any result.So what can i do in this situation?