SSH Execute command (wodSSH / wodSSH.NET)
I've written a program in C#, su - to root and after the conection and then the following works: then last does not? Is it because the return from cat /etc/group is more than one line?
string s, cmd;
Ssh1.Blocking=true;
cmd = grep + User + /etc/shadow
;
s = Ssh1.Execute(cmd);//Ssh1.Send( grep + User + /etc/passwd
);
DisplayUserShadowFileDetails(s.Substring(cmd.Length).TrimEnd(
.ToCharArray()));
Ssh1.Blocking=false;
Broken:
string s, cmd;
Ssh1.Blocking=true;
cmd = cat /etc/group
;
s = Ssh1.Execute(cmd);
s = s.Substring(cmd.Length).TrimEnd(
.ToCharArray());
Ssh1.Blocking=false;
String[] Groups = s.Split(
.ToCharArray());
Complete thread:
- SSH Execute command - Robert, 2004-10-14, 01:26
- Re: SSH Execute command - wodSupport, 2004-10-14, 01:29