Skip to content

mdimai666/SSH.Commander

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SSH.Commander logo

SSH.Commander

Nuget

dotnet library for convenient use of ssh

the library can use the config file ~/.ssh/config

Install

dotnet add package SSH.Commander

Reference

The project uses another git (without nuget):

https://github.com/JeremySkinner/Ssh-Config-Parser.git

Usage

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

About

dotnet library for convenient use of ssh

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages