Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I just received a spreadsheet containing quite a few user names and (unhashed) passwords. I need to salt these combinations, preferably with SHA. How would I approach such a task, given that I can't script?
What I wanna do with it:
I need to add those salted combinations (user:hashedpw) to a .htgroup file on a web server.
Can anyone help me out? Point me to a script or anything? I really need some help.
thank you for that tip. Just tried it. Converted the contents of the spreadsheet to a csv list containing the "user,password" combinations. Each in it's own line. The spreadsheet is located in my home directory.
If I try your code, I get the following:
Quote:
~$ tr '\n' , < users.csv | xargs -n2 -d, htpasswd -b -s .htgroup
xargs: htpasswd: No such file or directory
Creating a htpasswd file or directory, does not make any difference. What am I doing wrong?
Thank you very much so far for your help.
Jean-Luc.
all users and names ran through on my terminal....
Code:
...
Adding password for user Zidane
Adding password for user Zorn
Unfortunately the .htgroup file contains only the last user. In this case "Zorn". Does anybody have an idea what I can do to get all users and hashed passwords in that file?
Originally Posted by http://httpd.apache.org/docs/2.2/programs/htpasswd.html
htpasswd - Manage user files for basic authentication
...
Options
...
-c
Create the passwdfile. If passwdfile already exists, it is rewritten and truncated.
Passing -c will overwrite the file on every run (it's somewhat unfortunate there isn't an option to only create if doesn't exist...), maybe use touch to create it first:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.