Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mdimai666/ssh.commander
dotnet library for convenient use of ssh
https://github.com/mdimai666/ssh.commander
dotnet ssh
Last synced: about 2 months ago
JSON representation
dotnet library for convenient use of ssh
- Host: GitHub
- URL: https://github.com/mdimai666/ssh.commander
- Owner: mdimai666
- License: mit
- Created: 2024-02-01T05:23:59.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-02-02T05:54:32.000Z (12 months ago)
- Last Synced: 2024-11-04T23:51:44.961Z (2 months ago)
- Topics: dotnet, ssh
- Language: C#
- Homepage:
- Size: 56.6 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SSH.Commander
#### [![Nuget](https://img.shields.io/nuget/v/SSH.Commander)](https://www.nuget.org/packages/SSH.Commander/)
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](https://github.com/JeremySkinner/Ssh-Config-Parser.git)## Usage
```c#
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
```