<?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 Janusworx</title><link>https://janusworx.com/tags/htpasswd/</link><description>Recent content in Htpasswd on Janusworx</description><generator>Hugo -- gohugo.io</generator><language>en</language><managingEditor>feedback@janusworx.com (Mario Jason Braganza)</managingEditor><webMaster>feedback@janusworx.com (Mario Jason Braganza)</webMaster><copyright>© 2026, Mario Jason Braganza</copyright><lastBuildDate>Sat, 24 Jun 2023 15:16:26 +0530</lastBuildDate><atom:link href="https://janusworx.com/tags/htpasswd/index.xml" rel="self" type="application/rss+xml"/><item><title>htpasswd Notes to Self</title><link>https://janusworx.com/work/htpasswd-notes-to-self/</link><pubDate>Sat, 24 Jun 2023 15:16:26 +0530</pubDate><author>feedback@janusworx.com (Mario Jason Braganza)</author><guid>https://janusworx.com/work/htpasswd-notes-to-self/</guid><description>&lt;p&gt;To &lt;em&gt;create&lt;/em&gt; the &lt;code&gt;htpasswd&lt;/code&gt; file along with its first user, I just:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;htpasswd -c /path/to/htpasswdfile/htpasswd some-user&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;It’ll ask you for the password for that user, encrypt it and store it in that location.&lt;/p&gt;
&lt;p&gt;Add these lines to get Nginx to use the file for basic auth:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-nginx" data-lang="nginx"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;auth_basic&lt;/span&gt;	&lt;span class="s"&gt;&amp;#34;Login&lt;/span&gt; &lt;span class="s"&gt;to&lt;/span&gt; &lt;span class="s"&gt;Proceed:&lt;/span&gt; &lt;span class="s"&gt;&amp;#34;&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;#(or whatever message you want)
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;&lt;span class="k"&gt;auth_basic_user_file&lt;/span&gt; &lt;span class="s"&gt;/path/to/htpasswdfile/htpasswd&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;To &lt;em&gt;append&lt;/em&gt; &lt;em&gt;&lt;strong&gt;another&lt;/strong&gt;&lt;/em&gt; user to the &lt;code&gt;htpasswd&lt;/code&gt; file do:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;htpasswd /path/to/htpasswd/htpasswd second-user&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;That ought to do it.&lt;/p&gt;
&lt;p&gt;P.S. Install &lt;code&gt;apache-utils&lt;/code&gt; on Debian or use Paru/Yay to install &lt;code&gt;nginx_passwd&lt;/code&gt; on Arch.&lt;/p&gt;
&lt;p&gt;&lt;hr style='margin-left: auto; margin-right: auto; margin-bottom: 40px; margin-top: 50px; width:100px; border: none; background-color:rgb(238, 238, 238); color: rgb(238, 238, 238); height: 1px;'/&gt;

Feedback on this post? Mail me at &lt;a href="mailto:&amp;amp;#102;&amp;amp;%23101;&amp;amp;%23101;&amp;amp;%23100;&amp;amp;%2398;&amp;amp;%2397;&amp;amp;%2399;&amp;amp;%23107;&amp;amp;%2364;&amp;amp;%23106;&amp;amp;%2397;&amp;amp;%23110;&amp;amp;%23117;&amp;amp;%23115;&amp;amp;%23119;&amp;amp;%23111;&amp;amp;%23114;&amp;amp;%23120;&amp;amp;%2346;&amp;amp;%2399;&amp;amp;%23111;&amp;amp;%23109;" &gt;feedback@janusworx.com&lt;/a&gt;
&lt;br&gt;

&lt;br&gt;

P.P.S. Subscribe to my &lt;a href="https://janusworx.com/subscribe/" target="_blank" rel="noreferrer"&gt;mailing list!&lt;/a&gt;&lt;br&gt;
Forward these posts and letters to your friends and get them to subscribe!&lt;br&gt;
P.P.P.S. Feed my &lt;a href="https://www.amazon.in/hz/wishlist/ls/2QAUKHHAMOOVS?ref_=wl_share" target="_blank" rel="noreferrer"&gt;insatiable reading habit.&lt;/a&gt;&lt;/p&gt;</description></item></channel></rss>