dotnet library for convenient use of ssh
the library can use the config file ~/.ssh/config
dotnet add package SSH.Commander
The project uses another git (without nuget):
SshUri sshUri = new("myserver"); //hostname from ~/.ssh/config
// or
//SshUri sshUri = new("user:pass@sshhost:22");
var sshClient = new SshCommanderClient(sshUri.Host)
{
Config = new() { VerboseConsoleLog = true, UseUserSshConfigFile = true }
};
string command = " date && echo \"OK\"";
string output = await sshClient.RequestAsync(command);
// output:
// > Thu 01 Feb 2024 02:09:40 PM +09
// > OK