Can I copy/paste htpasswd files to my new server?
Asked Answered
J

4

10

I'm documenting the procedure for a full redeploy on my development server. Small staff, using Basic authentication (over SSL, of course) with an htpasswd file backend.

Is it safe to transfer the .htpasswd file as-is?

The Operating Systems will potentially differ, but the software on top (ie. Apache) will be the same.

Jeanniejeannine answered 4/11, 2008 at 20:36 Comment(0)
K
10

It's safe to transfer the htpasswd file no matter what architectures you are on. It is a text file. The only case in which you might need to do some conversions is to deal with line endings if you were moving between Unix and Windows, but between Linux/Unix boxes, no problems.

Kenay answered 4/11, 2008 at 20:40 Comment(0)
W
1

Short answer: Yes you can.

That's all you need to know.

Wimple answered 23/2, 2012 at 18:25 Comment(0)
S
0

If you're using apache, then the .htpasswd file should be the same. Just make sure you aren't overriding the password file to use in your new server config. And make sure you set proper permissions on the file so that you don't get any additional unauthorized entries.

Stenophyllous answered 4/11, 2008 at 20:41 Comment(0)
W
-1

If you use the same apache version you shouldn't have any problems just copying the .htpasswd files: They just contain the hashes that people's passwords are being compared with and the hashing is always the same (or it wouldn't work on any machine ;))

Weldonwelfare answered 4/11, 2008 at 20:40 Comment(1)
You say the "same apache version", implying that different Apache versions may have problems. However, the htpasswd format hasn't changed a number of years. If you are aware of incompatibilities with different Apache versions, please post them.Tiliaceous

© 2022 - 2024 — McMap. All rights reserved.