1

It is really annoying that there is no such topic about 'switching user with ssh.net'

Well, i tried it like below but it didn't work.

I have no idea about what can i do more. Can you show me?

SshClient cSSH = new SshClient("172.31.60.10", 22, "testuser", "oracle");
cSSH.Connect();

var command = cSSH.RunCommand("su - oracle");
command.Execute();

command = cSSH.RunCommand("oracle");
command.Execute();

command = cSSH.RunCommand("touch test");
command.Execute();

cSSH.Disconnect();
cSSH.Dispose();
  • 1
    See [Providing input/subcommands to a command (cli) executed with SSH.NET SshClient.RunCommand](https://stackoverflow.com/q/57666090/850848). – Martin Prikryl Jul 07 '20 at 10:38

0 Answers0