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

add user name and password? #24

Open
oz123 opened this issue Jul 28, 2019 · 4 comments
Open

add user name and password? #24

oz123 opened this issue Jul 28, 2019 · 4 comments

Comments

@oz123
Copy link
Contributor

oz123 commented Jul 28, 2019

Some (bad) clients can't work with FTP without user:pass combination.
But sometimes we must use them. Is there a change that this can be added to uftpd?

@troglobit
Copy link
Owner

Any user:pass combo is allowed, e.g. anonymous:a@b, but there is no per-user specific authentication. I have no personal interest in adding this to uftpd, since the major reason for its existence is to serve FTP read-only on a LAN.

However, if someone has a good idea and is willing to implement/debug/test it thoroughly I will consider the PR.

@oz123
Copy link
Contributor Author

oz123 commented Jul 28, 2019

Maybe q as hione can add simple pam support (with compile option)?

@troglobit
Copy link
Owner

It's very tricky to get right, even if you use libpam, and opens up for a lot of potential security bugs. Having a compile time option (configure) to disable/enable is only one strong requirement from my side.

I'd prefer not to do it at all and instead recommend folks to use vsftpd for such use-cases, but like I said, if someone has a good PR I'll consider it.

@oz123 oz123 changed the title add user name add password? add user name and password? Oct 10, 2022
@oz123
Copy link
Contributor Author

oz123 commented Oct 10, 2022

It's been a terrible long time, but I am feeling more comfortable with C. So I might give it a shot soon.
If someone feels like tackling this, here is where I would start:

static int check_user_pass(ctrl_t *ctrl)

One could implement httaccess file for access, it's a well known format and IMHO easier to use than libpam.
90% of the code for this can be taken from apache2 own code for managing the file. Specifically, look at how the flag -v works:

https://svn.apache.org/viewvc/httpd/httpd/branches/2.4.x/support/htpasswd.c?view=markup

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

No branches or pull requests

2 participants