Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standalone mode #19

Open
1mm0rt41PC opened this issue Mar 13, 2022 · 1 comment
Open

Standalone mode #19

1mm0rt41PC opened this issue Mar 13, 2022 · 1 comment

Comments

@1mm0rt41PC
Copy link

1mm0rt41PC commented Mar 13, 2022

I'm trying to create a standalone agent for Cygwin and Putty (like the one mentioned on dlech/KeeAgent#216) but I'm having trouble figuring out how to implement it.
I have actually do this sample but it doesn't work. Do you have a basic example ?

using dlech.SshAgentLib;
using System;
using System.Threading;

namespace StandaloneSSHAgent
{
	class Process
	{
		private static ManualResetEvent exitEvent = new ManualResetEvent(false);
		public static void Main(string[] args)
		{
			Console.CancelKeyPress += delegate(object sender, ConsoleCancelEventArgs e) {
				e.Cancel = true;
				exitEvent.Set();
			};
			PageantAgent pa = new PageantAgent();
			pa.StartCygwinSocket(GetEnvironmentVariable("SSH_AUTH_SOCK"));
			//pa.StartMsysSocket(GetEnvironmentVariable("SSH_AUTH_SOCK"));
			//pa.StartWslSocket(GetEnvironmentVariable("SSH_AUTH_SOCK"));
			pa.StartWindowsOpenSshPipe();
			
			exitEvent.WaitOne();
			Console.WriteLine("exited gracefully");
		}
	}
}
@dlech
Copy link
Owner

dlech commented Mar 14, 2022

You will also need to implement a callback to get the passphrase from the user.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants