{"id":3351,"date":"2010-07-10T03:46:10","date_gmt":"2010-07-10T07:46:10","guid":{"rendered":"http:\/\/g33kinfo.com\/info\/?p=3351"},"modified":"2010-07-10T03:46:10","modified_gmt":"2010-07-10T07:46:10","slug":"how-to-generate-a-htpasswd","status":"publish","type":"post","link":"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/","title":{"rendered":"How to generate a htpasswd"},"content":{"rendered":"<p>What is the best way to generate a htpasswd? <\/p>\n<p>htpasswd is used to generate, store and update the file used for basic http authentication. To create a new password file from the command line;<br \/>\n<code># htpasswd -c \/home\/user\/.htpasswd username<\/code><br \/>\nThe previous command will generate a new file called .htpasswd in the users \/home\/user directory and store an entry in it for the users username and hashed password. The user is prompted for the password and then again a second time for the password which completes the entry.<\/p>\n<p>To change or update the password in \/home\/user\/.htpasswd<br \/>\n<code># htpasswd \/home\/user\/.htpasswd username\/<\/code><br \/>\nThe user is prompted for the password twice and the password is then updated.<\/p>\n<p>If you do not have the program installed to do this, an error will be returned;<br \/>\n<code>The program 'htpasswd' can be found in the following packages:<br \/>\n * apache2-utils<br \/>\n * mini-httpd<br \/>\nTry: sudo apt-get install \"selected package\"<br \/>\n<\/code><\/p>\n<p>Select the apache2-utils to install by running the following command;<br \/>\n<code>user@mycomputer:~$ sudo apt-get install apache2-utils<br \/>\n[sudo] password for user:<br \/>\nReading package lists... Done<br \/>\nBuilding dependency tree<br \/>\nReading state information... Done<br \/>\nThe following extra packages will be installed:<br \/>\n  libapr1 libaprutil1<br \/>\nThe following NEW packages will be installed:<br \/>\n  apache2-utils libapr1 libaprutil1<br \/>\n0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.<br \/>\nNeed to get 361kB of archives.<br \/>\nAfter this operation, 922kB of additional disk space will be used.<br \/>\nDo you want to continue [Y\/n]? y<br \/>\nGet:1 http:\/\/archive.ubuntu.com\/ubuntu\/ lucid\/main libapr1 1.3.8-1build1 [116kB]<br \/>\nGet:2 http:\/\/archive.ubuntu.com\/ubuntu\/ lucid\/main libaprutil1 1.3.9+dfsg-3build1 [85.4kB]<br \/>\nGet:3 http:\/\/archive.ubuntu.com\/ubuntu\/ lucid\/main apache2-utils 2.2.14-5ubuntu8 [159kB]<br \/>\nFetched 361kB in 1s (285kB\/s)<br \/>\nSelecting previously deselected package libapr1.<br \/>\n(Reading database ... 276361 files and directories currently installed.)<br \/>\nUnpacking libapr1 (from ...\/libapr1_1.3.8-1build1_i386.deb) ...<br \/>\nSelecting previously deselected package libaprutil1.<br \/>\nUnpacking libaprutil1 (from ...\/libaprutil1_1.3.9+dfsg-3build1_i386.deb) ...<br \/>\nSelecting previously deselected package apache2-utils.<br \/>\nUnpacking apache2-utils (from ...\/apache2-utils_2.2.14-5ubuntu8_i386.deb) ...<br \/>\nProcessing triggers for man-db ...<br \/>\nSetting up libapr1 (1.3.8-1build1) ...<\/p>\n<p>Setting up libaprutil1 (1.3.9+dfsg-3build1) ...<\/p>\n<p>Setting up apache2-utils (2.2.14-5ubuntu8) ...<br \/>\nProcessing triggers for libc-bin ...<br \/>\nldconfig deferred processing now taking place<br \/>\nuser@mycomputer:~$<br \/>\n<\/code><br \/>\nnow try the command again using &#8220;password&#8221; as the password (don&#8217;t really use the word password for your password&#8230; derp)<br \/>\n<code><br \/>\nuser@mycomputer:~$ htpasswd -c \/home\/user\/.htpasswd user<br \/>\nNew password:<br \/>\nRe-type new password:<br \/>\nAdding password for user user<br \/>\nuser@mycomputer:~$ cat \/home\/user\/.htpasswd<br \/>\nuser:5UBsW0A43cEvs<br \/>\nuser@mycomputer:~$<br \/>\n<\/code><\/p>\n<p>When you cat the file, the username will be listed with the hashed password. To add a user to the existing file, simply run the command<br \/>\n<code>user@mycomputer:~$ htpasswd \/home\/user\/.htpasswd user<\/code><br \/>\nThis will add a new user to the file without overwriting the existing file.<br \/>\nThe -c creates a new password file. If password file already exists, it is overwritten and truncated or shortened. You can also use the -m parameter to force the md5 encryption of the password as opposed to just the basic apache authentication method.<\/p>\n<p><a href=\"http:\/\/www.htaccesstools.com\/htpasswd-generator\/\" target=\"_blank\" rel=\"noopener noreferrer\">Here is an online version using md5 to hash the password<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is the best way to generate a htpasswd? htpasswd is used to generate, store and update the file used for basic http authentication. To create a new password file from the command line; # htpasswd -c \/home\/user\/.htpasswd username The previous command will generate a new file called .htpasswd in the users \/home\/user directory and&#8230; <\/p>\n<div class=\"read-more navbutton\"><a href=\"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/\">Read More<i class=\"fa fa-angle-double-right\"><\/i><\/a><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-3351","post","type-post","status-publish","format-standard","hentry","category-info"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to generate a htpasswd - Linux Shtuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to generate a htpasswd - Linux Shtuff\" \/>\n<meta property=\"og:description\" content=\"What is the best way to generate a htpasswd? htpasswd is used to generate, store and update the file used for basic http authentication. To create a new password file from the command line; # htpasswd -c \/home\/user\/.htpasswd username The previous command will generate a new file called .htpasswd in the users \/home\/user directory and... Read More\" \/>\n<meta property=\"og:url\" content=\"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux Shtuff\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:author\" content=\"https:\/\/fb.me\/g33kinf0\" \/>\n<meta property=\"article:published_time\" content=\"2010-07-10T07:46:10+00:00\" \/>\n<meta name=\"author\" content=\"g33kadmin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@https:\/\/twitter.com\/drsinger1111\" \/>\n<meta name=\"twitter:site\" content=\"@drsinger1111\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/how-to-generate-a-htpasswd\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/how-to-generate-a-htpasswd\\\/\"},\"author\":{\"name\":\"g33kadmin\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"headline\":\"How to generate a htpasswd\",\"datePublished\":\"2010-07-10T07:46:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/how-to-generate-a-htpasswd\\\/\"},\"wordCount\":254,\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"articleSection\":[\"General Info\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/how-to-generate-a-htpasswd\\\/\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/how-to-generate-a-htpasswd\\\/\",\"name\":\"How to generate a htpasswd - Linux Shtuff\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\"},\"datePublished\":\"2010-07-10T07:46:10+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/how-to-generate-a-htpasswd\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/g33kinfo.com\\\/info\\\/how-to-generate-a-htpasswd\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/how-to-generate-a-htpasswd\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to generate a htpasswd\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#website\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/\",\"name\":\"Linux Shtuff\",\"description\":\"Because I have CRS Syndrome...\",\"publisher\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/#\\\/schema\\\/person\\\/c022e4c40b13ea1b678e6f020756f547\",\"name\":\"g33kadmin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"url\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"contentUrl\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\",\"width\":512,\"height\":512,\"caption\":\"g33kadmin\"},\"logo\":{\"@id\":\"https:\\\/\\\/g33kinfo.com\\\/info\\\/wp-content\\\/uploads\\\/2022\\\/07\\\/minion-researchA.gif\"},\"description\":\"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\\\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....\",\"sameAs\":[\"https:\\\/\\\/thelinuxreport.com\",\"https:\\\/\\\/fb.me\\\/g33kinf0\",\"https:\\\/\\\/x.com\\\/https:\\\/\\\/twitter.com\\\/drsinger1111\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to generate a htpasswd - Linux Shtuff","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:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/","og_locale":"en_US","og_type":"article","og_title":"How to generate a htpasswd - Linux Shtuff","og_description":"What is the best way to generate a htpasswd? htpasswd is used to generate, store and update the file used for basic http authentication. To create a new password file from the command line; # htpasswd -c \/home\/user\/.htpasswd username The previous command will generate a new file called .htpasswd in the users \/home\/user directory and... Read More","og_url":"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/","og_site_name":"Linux Shtuff","article_publisher":"https:\/\/fb.me\/g33kinf0","article_author":"https:\/\/fb.me\/g33kinf0","article_published_time":"2010-07-10T07:46:10+00:00","author":"g33kadmin","twitter_card":"summary_large_image","twitter_creator":"@https:\/\/twitter.com\/drsinger1111","twitter_site":"@drsinger1111","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/#article","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/"},"author":{"name":"g33kadmin","@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"headline":"How to generate a htpasswd","datePublished":"2010-07-10T07:46:10+00:00","mainEntityOfPage":{"@id":"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/"},"wordCount":254,"publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"articleSection":["General Info"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/","url":"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/","name":"How to generate a htpasswd - Linux Shtuff","isPartOf":{"@id":"https:\/\/g33kinfo.com\/info\/#website"},"datePublished":"2010-07-10T07:46:10+00:00","breadcrumb":{"@id":"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/g33kinfo.com\/info\/how-to-generate-a-htpasswd\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/g33kinfo.com\/info\/"},{"@type":"ListItem","position":2,"name":"How to generate a htpasswd"}]},{"@type":"WebSite","@id":"https:\/\/g33kinfo.com\/info\/#website","url":"https:\/\/g33kinfo.com\/info\/","name":"Linux Shtuff","description":"Because I have CRS Syndrome...","publisher":{"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/g33kinfo.com\/info\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/g33kinfo.com\/info\/#\/schema\/person\/c022e4c40b13ea1b678e6f020756f547","name":"g33kadmin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","url":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","contentUrl":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif","width":512,"height":512,"caption":"g33kadmin"},"logo":{"@id":"https:\/\/g33kinfo.com\/info\/wp-content\/uploads\/2022\/07\/minion-researchA.gif"},"description":"I am a g33k, Linux blogger, developer, student and Tech Writer for Liquidweb.com\/kb. My passion for all things tech drives my hunt for all the coolz. I often need a vacation after I get back from vacation....","sameAs":["https:\/\/thelinuxreport.com","https:\/\/fb.me\/g33kinf0","https:\/\/x.com\/https:\/\/twitter.com\/drsinger1111"]}]}},"_links":{"self":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/3351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/comments?post=3351"}],"version-history":[{"count":0,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/posts\/3351\/revisions"}],"wp:attachment":[{"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/media?parent=3351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/categories?post=3351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/g33kinfo.com\/info\/wp-json\/wp\/v2\/tags?post=3351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}