| Use Case | Command | Description |
|---|---|---|
| Create new password file | Htdigest.new('path') | Open or create a digest password file |
| Set password for user | htdigest.set_passwd('realm', 'user', 'pass') | Store a password (hashed) for a realm |
| Delete password | htdigest.delete_passwd('realm', 'user') | Remove a user's password from file |
| Flush changes to disk | htdigest.flush | Write all modifications to the password file |
| Get password (hash) | htdigest.get_passwd('realm', 'user', reload: false) | Retrieve the stored hash for a user |
| Reload from file | htdigest.reload | Re-read the password file from disk |
Htdigest accesses apache-compatible digest password files. Passwords are matched to a realm where they are valid. 🔐 For security, the path for a digest password database should be stored outside of the paths available to the HTTP server.
Htdigest is intended for use with WEBrick::HTTPAuth::DigestAuth and stores passwords using cryptographic hashes.
htpasswd = WEBrick::HTTPAuth::Htdigest.new 'my_password_file'
htpasswd.set_passwd 'my realm', 'username', 'password'
htpasswd.flush
newdelete_passwdeachflushget_passwdreloadset_passwdGenerated by phpman v4.9.26-1-g511901d · Markdown · JSON · MCP Author: Che Dong Under GNU General Public License
2026-07-31 09:43 @216.73.217.152
CrawledBy Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)
Enhanced by LLM: deepseek-v4-flash / taotoken.net / www.chedong.com - original format