I have a server with KSH (echo "$SHELL" the response is /usr/bin/ksh), if I connect to the server from MacOS's Terminal window and run command "printenv MyEnvVar" I could get a proper response.
But if I run following code in Windows (full .NET framework 4.7.2) by using same server, username, password.
class Program
{
static async Task Main(string[] args)
{
Licensing.Key = "==my-key==";
using (var session = new SshSession())
{
session.Connect("my-server");
session.Authenticate("username", "password");
string response;
using (var ssh = new Ssh())
{
ssh.Bind(session);
response = await ssh.RunCommandAsync("printenv MyEnvVar");
}
}
}
}
Nothing is from response. So what is the real difference? What can I do to have proper environment for this credential to login?