using
System;
using
System.Collections.Generic;
using
System.Text;
using
System.Net;
using
Nuane.Net;
namespace
Nuane.Samples
{
class
Program
{
static void Main(string[]
args)
{
SshKey rsaKey =
SshKey.Generate(SshKeyAlgorithm.RSA,
1024);
SshKey dssKey =
SshKey.Generate(SshKeyAlgorithm.DSS,
1024);
// add keys, bindings and users
SftpServer server = new SftpServer();
server.Log = Console.Out;
server.Keys.Add(rsaKey);
server.Keys.Add(dssKey);
server.Bindings.Add(IPAddress.Any,
22);
server.Users.Add(new
SshUser("user01",
"some-password", @"c:\data\user01"));
server.Users.Add(new SshUser("user02", "another-password", @"c:\data\user02"));
server.Start();
Console.WriteLine("Press
any key to stop the server.");
Console.ReadKey();
// stop the server
server.Stop();
}
}
}