C
C#2y ago
Theos

❔ SSH.Net commands not working

using (var client = new SshClient(_IP, _USER, _PASSWORD))
{
client.Connect();

using (var command = client.CreateCommand("ls && history"))
{
Console.Write(command.Execute());
}

client.Disconnect();
}
using (var client = new SshClient(_IP, _USER, _PASSWORD))
{
client.Connect();

using (var command = client.CreateCommand("ls && history"))
{
Console.Write(command.Execute());
}

client.Disconnect();
}
And when I run it it prints "snap". When I connect to my machine with putty and i run history after it I don't see "ls" nor "history".
2 Replies
Theos
TheosOP2y ago
okay now i tried screen -r 23057 and it printed "Must be connected to a terminal." so _IP is a string and it is correct for sure _USER is just "root" and _PASSWORD is a password for my root account i've verified these
Accord
Accord2y ago
Looks like nothing has happened here. I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server