need to convert passwd file to .htpasswd


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users need to convert passwd file to .htpasswd
# 1  
Old 12-18-2008
need to convert passwd file to .htpasswd

I need to take our unix password file and make the usernames and passwords in a .htpasswd file to protect some webpages. I really dont want to type them in. Any suggestions how I do this?

/---Frank----/
# 2  
Old 12-18-2008
for .htpasswd you usually just have to have a
Code:
username:passwordhash

So.. if your web server can handle your hash of choice, you simply need to get the username and hashes... should be able to get that from /etc/shadow (on most systems). What *ix are you using?

So in general:

cut -f1,2 -d: /etc/shadow

would suffice. But only if your passwords are in DES crypt format or MD5 (only on newer web servers). Other hashes may be possible, but in general you can only count on DES or MD5.
# 3  
Old 12-19-2008
We are running NIS on a solaris 8 box for our user accounts.
# 4  
Old 12-19-2008
also we are running this on apache 1.3.9 also running on solaris. Here is what our shadow structure looks like.

Last edited by frankkahle; 03-27-2009 at 01:15 PM..
# 5  
Old 12-19-2008
Ok... that actually should work as is... if you make it your .htpasswd file.

ypcat passwd >.htpasswd

I'm pretty sure the other fields won't matter as long as the first two are there.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX and Linux Applications

Authentication via .htaccess and .htpasswd

I've created .htaccess and use htpasswd comand to create .htpasswd Now when I try to access my protected area I still have loging panel. I checked apache error log lile and found that there is some problem with mismatch password. I use Apache 2.2 .22 Is there some erron in creating... (25 Replies)
Discussion started by: Budrys
25 Replies

2. Shell Programming and Scripting

Unable to convert passwd lastupdate value into scalar local format

Dear all, I am unable to get the desired result upon executing the below script. the problem is at `perl -le 'print scalar localtime $msecage'` ouput which gives the following result "Thu Jan 1 05:00:00 1970" instead of "Tue Nov 13 10:30:56 2012" but when I run the same command from shell... (2 Replies)
Discussion started by: m_raheelahmed
2 Replies

3. AIX

When did AIX start using /etc/security/passwd instead of /etc/passwd to store encrypted passwords?

Does anyone know when AIX started using /etc/security/passwd instead of /etc/passwd to store encrypted passwords? (1 Reply)
Discussion started by: Anne Neville
1 Replies

4. Solaris

passwd cmd reenables passwd aging in shadow entry

Hi Folks, I have Solaris 10, latest release. We have passwd aging set in /etc/defalut/passwd. I have an account that passwd should never expire. Acheived by emptying associated users shadow file entries for passwd aging. When I reset the users passwd using passwd command, it re enables... (3 Replies)
Discussion started by: BG_JrAdmin
3 Replies

5. UNIX for Dummies Questions & Answers

Resolved: htpasswd issues (-b) on FreeBSD

I wrote a script to batch-create directories with .htaccess and .htpasswd files. I am using the following line to create the .htpasswd file: htpasswd -cb .htpasswd $USER $PASS However, I keep getting this message in return: Usage: htpasswd passwordfile username The -c flag creates a new... (1 Reply)
Discussion started by: Spetnik
1 Replies

6. Solaris

tool to convert /etc/passwd and etc/shadow

i wonder if there is a tool to read the /etc/passwd or /etc/shadow files in order to reset user accounts to the same one. By moving (restore) all filessytem and data to another same Sun box, none of the users are able to logon to the new box which i didn't change nothing. But if i reset the user... (1 Reply)
Discussion started by: lamoul
1 Replies

7. Linux

htpasswd command not found

dear unix, need ur help, i have installed apache n apache is working... but i cant use htpasswd , the error said command not found. for web authentucation... thanks for any help :confused: (4 Replies)
Discussion started by: click007
4 Replies

8. Shell Programming and Scripting

help in /etc/passwd file

Hi all, As all of us know that in /etc/passwd file the first field correspond to username could any one tell me what is bin , damoen etc in the first field, and r they in user field , what is nologin in the last column ? root:x:0:0:root:/root:/bin/bash ... (4 Replies)
Discussion started by: useless79
4 Replies

9. Cybersecurity

/etc/passwd file

hi Does anyone anyone know what the last line of a unix user passwd file signifes? Mine shows "+:::::" best (4 Replies)
Discussion started by: s_mad010
4 Replies
Login or Register to Ask a Question