-
Notifications
You must be signed in to change notification settings - Fork 103
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 support for hashed passwords #876
Conversation
With the option to automatically hash plain-text passwords, running the server will neatly transform ftpserver.json like this, without breaking any formatting or changing/adding any other properties: {
"version": 1,
"accesses": [
{
"user": "test",
"pass": "test",
"fs": "os",
"params": {
"basePath": "/tmp"
}
}
],
"hash_plaintext_passwords": true,
"passive_transfer_port_range": {
"start": 2122,
"end": 2130
}
} ↓↓↓ {
"version": 1,
"accesses": [
{
"user": "test",
"pass": "$2a$10$xD02IYP4PnlOV1k6wxioluwj2q9JfVxikHho0hRdDcHJCS.iCodHC",
"fs": "os",
"params": {
"basePath": "/tmp"
}
}
],
"hash_plaintext_passwords": true,
"passive_transfer_port_range": {
"start": 2122,
"end": 2130
}
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @wanieru, I really like how you implemented it.
Thank you! |
You might be interested in how we implemented a cache for bcrypt to reduce connection times for repeated access. |
Based on: #873
I added support for both supplying hashed passwords into
ftpserver.json
, but also a config optionhash_plaintext_passwords
, which when loading a config will check if any passwords are plaintext, and re-encode the json-file after hashing them.