Skip to content

Instantly share code, notes, and snippets.

View blenderfreaky's full-sized avatar
fast

blenderfreaky

fast
View GitHub Profile
@blenderfreaky
blenderfreaky / Client.cs
Last active April 8, 2021 09:46
A hack for writing data to SshCommands
var envHome = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "USERPROFILE" : "HOME";
var home = Environment.GetEnvironmentVariable(envHome);
var ssh = new SshClient(new ConnectionInfo("localhost", Environment.UserName,
new PrivateKeyAuthenticationMethod(
Environment.UserName,
new PrivateKeyFile(home + "/.ssh/id_ed25519"))));
var command = ssh.CreateCommand("path/to/server");
command.BeginExecute();