{"id":49968,"date":"2025-02-26T12:30:00","date_gmt":"2025-02-26T18:30:00","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=49968"},"modified":"2025-03-19T04:29:08","modified_gmt":"2025-03-19T09:29:08","slug":"how-to-create-and-use-htpasswd","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/","title":{"rendered":"How to Create and Use .htpasswd"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div>\n<figure class=\"wp-block-image size-full\"><img decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd.webp\" alt=\"How to Create and Use .htpasswd\" class=\"wp-image-49972\" srcset=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd.webp 1024w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd-300x169.webp 300w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd-150x84.webp 150w, https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd-768x432.webp 768w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<p>A <strong>.htpasswd<\/strong> file typically creates and updates stored usernames and passwords for HTTP users using HTTP authentication. You must create a .htpasswd file to secure the website&#8217;s content, whether the primary URL or some subdirectory. Only authorized users will be able to access the website&#8217;s source. The username and password in the file are inline, separated by a colon. The username is stored in plain text, and the password is hashed, usually with MD5 encryption.<\/p>\n\n\n\n<p>The .htpasswd is in the .htaccess file in the website&#8217;s document root. The .htaccess file is a configuration file used by Apache-based web servers. Many possibilities exist with the .htaccess file, and one of them is including the <strong>.htpasswd<\/strong> file.<\/p>\n\n\n\n<p>In this post, we will use already installed WordPress with the LAMP stack on Ubuntu 24.04 OS to configure HTTP authentication with the <strong>.htpasswd<\/strong> file. Creating and configuring it is straightforward and may take around 5 minutes. Let&#8217;s get started!<\/p>\n\n\n\n<!--more-->\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_82_2 counter-hierarchy ez-toc-counter ez-toc-transparent ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-69ec8dac192ac\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-69ec8dac192ac\"  aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#Prerequisites\" >Prerequisites<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#Update-the-System\" >Update the System<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#Create-htpasswd-file\" >Create .htpasswd file<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#Import-the-htpasswd-File\" >Import the .htpasswd File<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#More-about-htpasswd-command\" >More about htpasswd command<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Prerequisites\"><\/span>Prerequisites<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A server with Ubuntu 24.04 as OS<\/li>\n\n\n\n<li>WordPress installation with a LAMP stack<\/li>\n\n\n\n<li>User privileges: root or non-root user with sudo privileges<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Update-the-System\"><\/span>Update the System<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>Before we start any action on the server, we will update the system packages to their latest versions available:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt update -y &amp;&amp; sudo apt upgrade -y<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Create-htpasswd-file\"><\/span>Create .htpasswd file<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>To create the file, you can use the .htpasswd command, which is available after the Apache web server installation. Since we mentioned that in this tutorial, we will use WordPress with the LAMP stack, the command is available on our server.<\/p>\n\n\n\n<p>The syntax of the command is the following:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">htpasswd -c \"website_document_root\"\/.htpasswd \"username\" <\/pre>\n\n\n\n<p>To create a .htpasswd file with username &#8220;rhtest&#8221; into the document root &#8220;\/var\/www\/html&#8221; execute the command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">htpasswd -c \/var\/www\/html\/.htpasswd rhtest<\/pre>\n\n\n\n<p>You will be asked to type the password twice, and once you set that, you should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:\/var\/www\/html# htpasswd -c \/var\/www\/html\/.htpasswd rhtest\nNew password:\nRe-type new password:\nAdding password for user rhtest\n<\/pre>\n\n\n\n<p>To check the content of the &#8220;.htpasswd&#8221; file, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cat \/var\/www\/html\/.htpasswd<\/pre>\n\n\n\n<p>You will receive output similar to this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">rhtest:$apr1$rDodiIIG$p6Q1GpNmJsgW88nIa.nA6\/<\/pre>\n\n\n\n<p>As you can see, the username is &#8220;rhtest&#8221;, and the password is hashed. The last thing of this process is to set the correct permissions to the .htpasswd file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chmod 644 .htpasswd<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Import-the-htpasswd-File\"><\/span>Import the .htpasswd File<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>The next step is to import the file into the .htaccess file of your WordPress. To do that, open the .htaccess file with your favorite editor and paste the following lines of code at the bottom of the file:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#Whole Document root (our document root is \/var\/www\/html)\nAuthName \"Dialog prompt\"\nAuthType Basic\nAuthUserFile \/var\/www\/html\/.htpasswd\nRequire valid-user\n<\/pre>\n\n\n\n<p>Save the file, close it, and restart the Apache2 web server.<\/p>\n\n\n\n<p>These lines of code secured the whole website directories and subdirectories.<\/p>\n\n\n\n<p>For example, if you want to secure only one specific file, let&#8217;s say <strong>wp-login.php<\/strong>, instead of the previous line, you can add this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#Single file<br><br>&lt;FilesMatch \"wp-login.php\"><br>AuthName \"Dialog prompt\"<br>AuthType Basic<br>AuthUserFile \/var\/www\/html\/.htpasswd<br>Require valid-user<br>&lt;\/FilesMatch> <br><br><\/pre>\n\n\n\n<p>To protect multiple files, you can use the following lines of code:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#Multiple files<br><br>&lt;FilesMatch \"*.*\"><br>AuthName \"Dialog prompt\"<br>AuthType Basic<br>AuthUserFile \/var\/www\/html\/.htpasswd<br>Require valid-user<br>&lt;\/FilesMatch> <br><br><\/pre>\n\n\n\n<p>To protect a subdirectory in WordPress, copy the <strong>.htpasswd<\/strong> file into that subdirectory or create a symbolic link. The lines of code for protecting the &#8220;wp-admin&#8221; subdirectory would be:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">#Protect Directory\nAuthName \"Dialog prompt\"\nAuthType Basic\nAuthUserFile \/var\/www\/html\/wp-admin\/.htpasswd\nRequire valid-user\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"More-about-htpasswd-command\"><\/span>More about htpasswd command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>If you want to know in more detail about the &#8220;htpasswd&#8221; command, you can execute the command below:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">man htpasswd<\/pre>\n\n\n\n<p>You should get the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">HTPASSWD(1)                                                                   htpasswd                                                                  HTPASSWD(1)\n\nNAME\n       htpasswd - Manage user files for basic authentication\n\nSYNOPSIS\n       htpasswd [ -c ] [ -i ] [ -m | -B | -d | -s | -p ] [ -C cost ] [ -D ] [ -v ] passwdfile username\n\n       htpasswd -b [ -c ] [ -m | -B | -d | -s | -p ] [ -C cost ] [ -D ] [ -v ] passwdfile username password\n\n       htpasswd -n [ -i ] [ -m | -B | -d | -s | -p ] [ -C cost ] username\n\n       htpasswd -nb [ -m | -B | -d | -s | -p ] [ -C cost ] username password\n\nSUMMARY\n       htpasswd  is used to create and update the flat-files used to store usernames and password for basic authentication of HTTP users. If htpasswd cannot access\n       a file, such as not being able to write to the output file or not being able to read the file in order to update it, it returns an error status and makes no\n       changes.\n\n       Resources available from the Apache HTTP server can be restricted to just the users listed in the files created by htpasswd. This program  can  only  manage\n       usernames  and  passwords stored in a flat-file. It can encrypt and display password information for use in other types of data stores, though. To use a DBM\n       database see dbmmanage or htdbm.\n\n       htpasswd encrypts passwords using either bcrypt, a version of MD5 modified for Apache, SHA1, or the system's crypt() routine. Files managed by htpasswd  may\n       contain  a  mixture of different encoding types of passwords; some user records may have bcrypt or MD5-encrypted passwords while others in the same file may\n       have passwords encrypted with crypt().\n\n       This manual page only lists the command line arguments. For details of the directives necessary to configure user authentication in  httpd  see  the  Apache\n       manual, which is part of the Apache distribution or can be found at http:\/\/httpd.apache.org\/.\n\nOPTIONS\n       -b     Use  batch  mode;  i.e., get the password from the command line rather than prompting for it. This option should be used with extreme care, since the\n              password is clearly visible on the command line. For script use see the -i option. Available in 2.4.4 and later.\n\n       -i     Read the password from stdin without verification (for script usage).\n\n       -c     Create the passwdfile. If passwdfile already exists, it is rewritten and truncated. This option cannot be combined with the -n option.\n\n       -n     Display the results on standard output rather than updating a file. This is useful for generating password records acceptable to Apache for inclusion\n              in non-text data stores. This option changes the syntax of the command line, since the passwdfile argument (usually the first  one)  is  omitted.  It\n              cannot be combined with the -c option.\n\n       -m     Use MD5 encryption for passwords. This is the default (since version 2.2.18).\n<\/pre>\n\n\n\n<p>That&#8217;s it. You successfully created and configured the .htpasswd file on Ubuntu 24.04. Of course, you do not have to do this on your own. If you have difficulties with securing your website via HTTP authentication you only need to sign up for one of our NVMe <a href=\"https:\/\/www.rosehosting.com\/linux-vps-hosting\/\" target=\"_blank\" rel=\"noreferrer noopener\">Linux VPS plans<\/a> and submit a support ticket. Our admins will help you with any aspect of securing your website. Feel free to contact us. We are available 24\/7.<\/p>\n\n\n\n<p>PS. If you liked this post about creating and using the .htpasswd file, please share it with your friends on social networks or simply leave a comment in the comments section. Thank you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A .htpasswd file typically creates and updates stored usernames and passwords for HTTP users using HTTP authentication. You must create &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to Create and Use .htpasswd\" class=\"read-more button\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#more-49968\" aria-label=\"Read more about How to Create and Use .htpasswd\">Read More<\/a><\/p>\n","protected":false},"author":4,"featured_media":49972,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1703],"tags":[2153,1940,2240,65],"class_list":["post-49968","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-security","tag-how-to-2","tag-how-to-create","tag-htpasswd-2","tag-security","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-33"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.4 (Yoast SEO v27.4) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>.htpasswd - What is it? Learn How to Create and Use It. | RoseHosting<\/title>\n<meta name=\"description\" content=\"Learn how to create and use the .htpasswd file using our latest easy-to-follow guide and secure your stored usernames and passwords.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create and Use .htpasswd\" \/>\n<meta property=\"og:description\" content=\"How to Create and Use .htpasswd | RoseHosting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/\" \/>\n<meta property=\"og:site_name\" content=\"RoseHosting\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/RoseHosting\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/rosehosting.helpdesk\" \/>\n<meta property=\"article:published_time\" content=\"2025-02-26T18:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-19T09:29:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"576\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"Jeff Wilson\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:site\" content=\"@rosehosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jeff Wilson\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/\"},\"author\":{\"name\":\"Jeff Wilson\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\"},\"headline\":\"How to Create and Use .htpasswd\",\"datePublished\":\"2025-02-26T18:30:00+00:00\",\"dateModified\":\"2025-03-19T09:29:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/\"},\"wordCount\":613,\"commentCount\":2,\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/how-to-create-and-use-htpasswd.webp\",\"keywords\":[\"how to\",\"how to create\",\"htpasswd\",\"security\"],\"articleSection\":[\"Security\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/\",\"name\":\".htpasswd - What is it? Learn How to Create and Use It. | RoseHosting\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/how-to-create-and-use-htpasswd.webp\",\"datePublished\":\"2025-02-26T18:30:00+00:00\",\"dateModified\":\"2025-03-19T09:29:08+00:00\",\"description\":\"Learn how to create and use the .htpasswd file using our latest easy-to-follow guide and secure your stored usernames and passwords.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/how-to-create-and-use-htpasswd.webp\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2025\\\/02\\\/how-to-create-and-use-htpasswd.webp\",\"width\":1024,\"height\":576,\"caption\":\"How to Create and Use .htpasswd\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/how-to-create-and-use-htpasswd\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Create and Use .htpasswd\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"name\":\"RoseHosting.com\",\"description\":\"Premium Linux Tutorials Since 2001\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#organization\",\"name\":\"RoseHosting\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"contentUrl\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/03\\\/android-chrome-192x192-1.png\",\"width\":192,\"height\":192,\"caption\":\"RoseHosting\"},\"image\":{\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/RoseHosting\",\"https:\\\/\\\/x.com\\\/rosehosting\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/rosehosting\\\/\"],\"description\":\"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.\",\"email\":\"info@rosehosting.com\",\"telephone\":\"(314) 275-0414\",\"legalName\":\"Rose Web Services LLC\",\"foundingDate\":\"2001-04-02\",\"numberOfEmployees\":{\"@type\":\"QuantitativeValue\",\"minValue\":\"11\",\"maxValue\":\"50\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/#\\\/schema\\\/person\\\/7ce77a842fa6a9a7f8efa186f2353713\",\"name\":\"Jeff Wilson\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g\",\"caption\":\"Jeff Wilson\"},\"description\":\"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.\",\"sameAs\":[\"https:\\\/\\\/www.rosehosting.com\",\"https:\\\/\\\/www.facebook.com\\\/rosehosting.helpdesk\"],\"url\":\"https:\\\/\\\/www.rosehosting.com\\\/blog\\\/author\\\/jwilson\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":".htpasswd - What is it? Learn How to Create and Use It. | RoseHosting","description":"Learn how to create and use the .htpasswd file using our latest easy-to-follow guide and secure your stored usernames and passwords.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/","og_locale":"en_US","og_type":"article","og_title":"How to Create and Use .htpasswd","og_description":"How to Create and Use .htpasswd | RoseHosting","og_url":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/","og_site_name":"RoseHosting","article_publisher":"https:\/\/www.facebook.com\/RoseHosting","article_author":"https:\/\/www.facebook.com\/rosehosting.helpdesk","article_published_time":"2025-02-26T18:30:00+00:00","article_modified_time":"2025-03-19T09:29:08+00:00","og_image":[{"width":1024,"height":576,"url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd.webp","type":"image\/webp"}],"author":"Jeff Wilson","twitter_card":"summary_large_image","twitter_creator":"@rosehosting","twitter_site":"@rosehosting","twitter_misc":{"Written by":"Jeff Wilson","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#article","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/"},"author":{"name":"Jeff Wilson","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713"},"headline":"How to Create and Use .htpasswd","datePublished":"2025-02-26T18:30:00+00:00","dateModified":"2025-03-19T09:29:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/"},"wordCount":613,"commentCount":2,"publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd.webp","keywords":["how to","how to create","htpasswd","security"],"articleSection":["Security"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/","url":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/","name":".htpasswd - What is it? Learn How to Create and Use It. | RoseHosting","isPartOf":{"@id":"https:\/\/www.rosehosting.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#primaryimage"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#primaryimage"},"thumbnailUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd.webp","datePublished":"2025-02-26T18:30:00+00:00","dateModified":"2025-03-19T09:29:08+00:00","description":"Learn how to create and use the .htpasswd file using our latest easy-to-follow guide and secure your stored usernames and passwords.","breadcrumb":{"@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#primaryimage","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd.webp","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2025\/02\/how-to-create-and-use-htpasswd.webp","width":1024,"height":576,"caption":"How to Create and Use .htpasswd"},{"@type":"BreadcrumbList","@id":"https:\/\/www.rosehosting.com\/blog\/how-to-create-and-use-htpasswd\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.rosehosting.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Create and Use .htpasswd"}]},{"@type":"WebSite","@id":"https:\/\/www.rosehosting.com\/blog\/#website","url":"https:\/\/www.rosehosting.com\/blog\/","name":"RoseHosting.com","description":"Premium Linux Tutorials Since 2001","publisher":{"@id":"https:\/\/www.rosehosting.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.rosehosting.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.rosehosting.com\/blog\/#organization","name":"RoseHosting","url":"https:\/\/www.rosehosting.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","contentUrl":"https:\/\/www.rosehosting.com\/blog\/wp-content\/uploads\/2022\/03\/android-chrome-192x192-1.png","width":192,"height":192,"caption":"RoseHosting"},"image":{"@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/RoseHosting","https:\/\/x.com\/rosehosting","https:\/\/www.linkedin.com\/in\/rosehosting\/"],"description":"RoseHosting is a leading Linux hosting provider, serving thousands of clients world-wide since 2001.","email":"info@rosehosting.com","telephone":"(314) 275-0414","legalName":"Rose Web Services LLC","foundingDate":"2001-04-02","numberOfEmployees":{"@type":"QuantitativeValue","minValue":"11","maxValue":"50"}},{"@type":"Person","@id":"https:\/\/www.rosehosting.com\/blog\/#\/schema\/person\/7ce77a842fa6a9a7f8efa186f2353713","name":"Jeff Wilson","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0985fed6af04cc60703d2ecf27c65dfa373e0ca00eb21c0b03477e099ea3f99f?s=96&r=g","caption":"Jeff Wilson"},"description":"An experienced Linux veteran with many years of experience. Helping other Linux admins with frequent Linux and business-related blog posts on the RoseHosting blog. Techie by choice. Loving nature and travel. Happily married and father of two lovely children.","sameAs":["https:\/\/www.rosehosting.com","https:\/\/www.facebook.com\/rosehosting.helpdesk"],"url":"https:\/\/www.rosehosting.com\/blog\/author\/jwilson\/"}]}},"_links":{"self":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/49968","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/comments?post=49968"}],"version-history":[{"count":4,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/49968\/revisions"}],"predecessor-version":[{"id":50237,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/posts\/49968\/revisions\/50237"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media\/49972"}],"wp:attachment":[{"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/media?parent=49968"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/categories?post=49968"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rosehosting.com\/blog\/wp-json\/wp\/v2\/tags?post=49968"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}