FubarDevelopment / FtpServer

Portable FTP server written in .NET
http://fubardevelopment.github.io/FtpServer/
MIT License
472 stars 161 forks source link

A simple help wouldn't be bad at all friends 💥 #156

Closed SnowdenDev closed 8 months ago

SnowdenDev commented 8 months ago

Please, I can't find how to set a username and password for the ftp server, can someone tell me how I can do it, this is my current code: static async Task Main(string[] args) { var services = new ServiceCollection(); services.Configure(opt => opt.RootPath = "TestFtpServer"); services.Configure(opt => opt.ServerAddress = "127.0.0.1"); services.AddFtpServer(builder => builder.UseDotNetFileSystem()); using (var serviceProvider = services.BuildServiceProvider()) { var ftpServerHost = serviceProvider.GetRequiredService(); await ftpServerHost.StartAsync(); Console.WriteLine("Press ENTER/RETURN to close the test application."); Console.ReadLine(); await ftpServerHost.StopAsync(); } }

fubar-coder commented 8 months ago

You need to provide your own IMembershipProvider service.

There is also a small article about the authentication methods supported out of the box: Authentication

You can also find a sample implementation in this comment: https://github.com/FubarDevelopment/FtpServer/issues/19#issuecomment-333029170