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

New Post: su command

$
0
0

Hi

how can I execute the su linux command? I've this code:

        public void sshTest()
        {
            using (var client = new SshClient("host", "myuser", "mypassword"))
            {
                client.Connect();
                var cmd.Execute("su - root");
                string errore = cmd.Error;
                cmd.Execute("rootpwd");
                result = cmd.Result;
                client.Disconnect();
               
            }
        }

after the command var cmd.Execute("su - root"); the command.Error contains "standard in must be a tty\n". Any suggestion?

thank you

Daniele


Viewing all articles
Browse latest Browse all 1729

Latest Images

Trending Articles



Latest Images