<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Htpasswd on nagg.eu</title><link>https://nagg.eu/tags/htpasswd/</link><description>Recent content in Htpasswd on nagg.eu</description><generator>Hugo</generator><language>en</language><lastBuildDate>Sun, 01 Sep 2019 00:00:00 +0000</lastBuildDate><atom:link href="https://nagg.eu/tags/htpasswd/index.xml" rel="self" type="application/rss+xml"/><item><title>FreeBSD, Nginx and htpasswd file generation</title><link>https://nagg.eu/freebsd-nginx-and-htpasswd-file-generation/</link><pubDate>Sun, 01 Sep 2019 00:00:00 +0000</pubDate><guid>https://nagg.eu/freebsd-nginx-and-htpasswd-file-generation/</guid><description>&lt;p&gt;On most Linux distros it is possible to generate the htpasswd file entries simply
using the &lt;code&gt;htpasswd&lt;/code&gt; command line util.&lt;br&gt;
On FreeBSD the easiest way to accomplish the same task is using OpenSSL itself:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;
openssl passwd -apr1
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;Enter the password twice to get a nice hash, copy that in the htpasswd file
with the usual &lt;code&gt;user:password_hash&lt;/code&gt; syntax.&lt;/p&gt;</description></item><item><title>Nginx and password protected pages</title><link>https://nagg.eu/nginx-and-password-protected-pages/</link><pubDate>Wed, 05 Mar 2014 11:26:24 +0000</pubDate><guid>https://nagg.eu/nginx-and-password-protected-pages/</guid><description>&lt;p&gt;To password protect a directory &lt;code&gt;xyz&lt;/code&gt; and every file and subdirectory in it open the configuration file (nginx.conf or one of the virtual host configuration files) and add the following two lines:&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;location /xyz/ {
 auth_basic &amp;#34;Restricted Area&amp;#34;;
 auth_basic_user_file conf.d/htpasswd;
}
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;htpasswd file must be encrypted, it can be created using a tool named htpasswd.&lt;/p&gt;
&lt;pre tabindex="0"&gt;&lt;code&gt;[root@xenserver ~]# cd /etc/nginx/conf.d/
[root@xenserver ~]# htpasswd -b htpasswd user password
&lt;/code&gt;&lt;/pre&gt;</description></item></channel></rss>