{"id":5693,"date":"2023-02-16T15:24:04","date_gmt":"2023-02-16T09:54:04","guid":{"rendered":"https:\/\/trysiteprice.com\/blog\/?p=5693"},"modified":"2023-02-16T15:24:04","modified_gmt":"2023-02-16T09:54:04","slug":"centos-redhat-set-password-quality-requirements","status":"publish","type":"post","link":"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/","title":{"rendered":"CentOS \/ RedHat: Set Password Quality Requirements"},"content":{"rendered":"<p>In CentOS and Red Hat, you can set password quality requirements using the <code>pwquality<\/code> module. This module is used by the PAM (Pluggable Authentication Modules) system to enforce password quality policies. Here are the steps to set password quality requirements:<\/p>\n<ol>\n<li>Install the <code>libpwquality<\/code> package if it is not already installed:\n<div class=\"bg-black mb-4 rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs\">sudo yum install libpwquality<br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li>Open the <code>pam_pwquality.conf<\/code> file for editing:\n<div class=\"bg-black mb-4 rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">sudo vi \/etc\/security\/pwquality.conf<br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li>In the <code>pam_pwquality.conf<\/code> file, you can set the following parameters to define the password quality requirements:\n<ul>\n<li><code>minlen<\/code>: The minimum length of the password (default: 9)<\/li>\n<li><code>minclass<\/code>: The minimum number of character classes (default: 4)<\/li>\n<li><code>maxrepeat<\/code>: The maximum number of repeated characters (default: 3)<\/li>\n<li><code>dcredit<\/code>: The credit given for a digit (default: -1)<\/li>\n<li><code>ucredit<\/code>: The credit given for an uppercase letter (default: -1)<\/li>\n<li><code>lcredit<\/code>: The credit given for a lowercase letter (default: -1)<\/li>\n<li><code>ocredit<\/code>: The credit given for a special character (default: -1)<\/li>\n<li><code>minlower<\/code>: The minimum number of lowercase letters (default: 0)<\/li>\n<li><code>minupper<\/code>: The minimum number of uppercase letters (default: 0)<\/li>\n<li><code>mindigit<\/code>: The minimum number of digits (default: 0)<\/li>\n<li><code>minspecial<\/code>: The minimum number of special characters (default: 0)<\/li>\n<\/ul>\n<p>For example, to set a minimum password length of 12 and require at least one digit, one uppercase letter, one lowercase letter, and one special character, you would add the following lines to the <code>pam_pwquality.conf<\/code> file:<\/p>\n<div class=\"bg-black mb-4 rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-makefile\">minlen = 12<br \/>\ndcredit = 1<br \/>\nucredit = 1<br \/>\nlcredit = 1<br \/>\nocredit = 1<br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li>Save and close the <code>pam_pwquality.conf<\/code> file.<\/li>\n<li>To enforce the password quality requirements, you need to add the <code>pam_pwquality.so<\/code> module to the PAM configuration for the system&#8217;s password management. Open the <code>system-auth<\/code> file for editing:\n<div class=\"bg-black mb-4 rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-bash\">sudo vi \/etc\/pam.d\/system-auth<br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li>Add the following line at the top of the file:\n<div class=\"bg-black mb-4 rounded-md\">\n<div class=\"flex items-center relative text-gray-200 bg-gray-800 px-4 py-2 text-xs font-sans\"><\/div>\n<div class=\"p-4 overflow-y-auto\"><code class=\"!whitespace-pre hljs language-ruby\">password requisite pam_pwquality.so try_first_pass local_users_only <span class=\"hljs-keyword\">retry<\/span>=<span class=\"hljs-number\">3<\/span> authtok_type=<br \/>\n<\/code><\/div>\n<\/div>\n<p>This line ensures that the <code>pam_pwquality.so<\/code> module is used to enforce password quality requirements for local users. If you want to enforce password quality requirements for remote users as well, you need to add the line to the <code>password-auth<\/code> file.<\/li>\n<li>Save and close the <code>system-auth<\/code> file.<\/li>\n<\/ol>\n<p>After making these changes, the PAM system will enforce the password quality requirements defined in the <code>pam_pwquality.conf<\/code> file when users change their passwords.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In CentOS and Red Hat, you can set password quality requirements using the pwquality module. This module is used by the PAM (Pluggable Authentication Modules) system to enforce password quality policies. Here are the steps to set password quality requirements: Install the libpwquality package if it is not already installed: sudo yum install libpwquality Open &#8230; <a title=\"CentOS \/ RedHat: Set Password Quality Requirements\" class=\"read-more\" href=\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/\" aria-label=\"Read more about CentOS \/ RedHat: Set Password Quality Requirements\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-5693","post","type-post","status-publish","format-standard","hentry","category-best-tutorial"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CentOS \/ RedHat: Set Password Quality Requirements - TrySitePrice<\/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:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CentOS \/ RedHat: Set Password Quality Requirements - TrySitePrice\" \/>\n<meta property=\"og:description\" content=\"In CentOS and Red Hat, you can set password quality requirements using the pwquality module. This module is used by the PAM (Pluggable Authentication Modules) system to enforce password quality policies. Here are the steps to set password quality requirements: Install the libpwquality package if it is not already installed: sudo yum install libpwquality Open ... Read more\" \/>\n<meta property=\"og:url\" content=\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/\" \/>\n<meta property=\"og:site_name\" content=\"TrySitePrice\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-16T09:54:04+00:00\" \/>\n<meta name=\"author\" content=\"Rahul Sahu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/\"},\"author\":{\"name\":\"Rahul Sahu\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/358e04eeea4281deacad2f30c58e67f4\"},\"headline\":\"CentOS \/ RedHat: Set Password Quality Requirements\",\"datePublished\":\"2023-02-16T09:54:04+00:00\",\"dateModified\":\"2023-02-16T09:54:04+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/\"},\"wordCount\":297,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/#organization\"},\"articleSection\":[\"Best\/Tutorial\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/\",\"url\":\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/\",\"name\":\"CentOS \/ RedHat: Set Password Quality Requirements - TrySitePrice\",\"isPartOf\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/#website\"},\"datePublished\":\"2023-02-16T09:54:04+00:00\",\"dateModified\":\"2023-02-16T09:54:04+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/trysiteprice.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CentOS \/ RedHat: Set Password Quality Requirements\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#website\",\"url\":\"https:\/\/trysiteprice.com\/blog\/\",\"name\":\"TrySitePrice\",\"description\":\"Free Website Value Calculator Tool\",\"publisher\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/trysiteprice.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#organization\",\"name\":\"TrySitePrice\",\"url\":\"https:\/\/trysiteprice.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/trysiteprice.com\/blog\/wp-content\/uploads\/2021\/12\/cropped-trysiteprice-logo.png\",\"contentUrl\":\"https:\/\/trysiteprice.com\/blog\/wp-content\/uploads\/2021\/12\/cropped-trysiteprice-logo.png\",\"width\":395,\"height\":268,\"caption\":\"TrySitePrice\"},\"image\":{\"@id\":\"https:\/\/trysiteprice.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/358e04eeea4281deacad2f30c58e67f4\",\"name\":\"Rahul Sahu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/51f0f95f7b95665f62baed2211572165?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/51f0f95f7b95665f62baed2211572165?s=96&d=mm&r=g\",\"caption\":\"Rahul Sahu\"},\"sameAs\":[\"https:\/\/trysiteprice.com\/blog\"],\"url\":\"https:\/\/trysiteprice.com\/blog\/author\/rsahu4242_trysiteprice\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CentOS \/ RedHat: Set Password Quality Requirements - TrySitePrice","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:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/","og_locale":"en_US","og_type":"article","og_title":"CentOS \/ RedHat: Set Password Quality Requirements - TrySitePrice","og_description":"In CentOS and Red Hat, you can set password quality requirements using the pwquality module. This module is used by the PAM (Pluggable Authentication Modules) system to enforce password quality policies. Here are the steps to set password quality requirements: Install the libpwquality package if it is not already installed: sudo yum install libpwquality Open ... Read more","og_url":"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/","og_site_name":"TrySitePrice","article_published_time":"2023-02-16T09:54:04+00:00","author":"Rahul Sahu","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/#article","isPartOf":{"@id":"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/"},"author":{"name":"Rahul Sahu","@id":"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/358e04eeea4281deacad2f30c58e67f4"},"headline":"CentOS \/ RedHat: Set Password Quality Requirements","datePublished":"2023-02-16T09:54:04+00:00","dateModified":"2023-02-16T09:54:04+00:00","mainEntityOfPage":{"@id":"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/"},"wordCount":297,"commentCount":0,"publisher":{"@id":"https:\/\/trysiteprice.com\/blog\/#organization"},"articleSection":["Best\/Tutorial"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/","url":"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/","name":"CentOS \/ RedHat: Set Password Quality Requirements - TrySitePrice","isPartOf":{"@id":"https:\/\/trysiteprice.com\/blog\/#website"},"datePublished":"2023-02-16T09:54:04+00:00","dateModified":"2023-02-16T09:54:04+00:00","breadcrumb":{"@id":"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/trysiteprice.com\/blog\/centos-redhat-set-password-quality-requirements\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/trysiteprice.com\/blog\/"},{"@type":"ListItem","position":2,"name":"CentOS \/ RedHat: Set Password Quality Requirements"}]},{"@type":"WebSite","@id":"https:\/\/trysiteprice.com\/blog\/#website","url":"https:\/\/trysiteprice.com\/blog\/","name":"TrySitePrice","description":"Free Website Value Calculator Tool","publisher":{"@id":"https:\/\/trysiteprice.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/trysiteprice.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/trysiteprice.com\/blog\/#organization","name":"TrySitePrice","url":"https:\/\/trysiteprice.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trysiteprice.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/trysiteprice.com\/blog\/wp-content\/uploads\/2021\/12\/cropped-trysiteprice-logo.png","contentUrl":"https:\/\/trysiteprice.com\/blog\/wp-content\/uploads\/2021\/12\/cropped-trysiteprice-logo.png","width":395,"height":268,"caption":"TrySitePrice"},"image":{"@id":"https:\/\/trysiteprice.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/358e04eeea4281deacad2f30c58e67f4","name":"Rahul Sahu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/trysiteprice.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/51f0f95f7b95665f62baed2211572165?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/51f0f95f7b95665f62baed2211572165?s=96&d=mm&r=g","caption":"Rahul Sahu"},"sameAs":["https:\/\/trysiteprice.com\/blog"],"url":"https:\/\/trysiteprice.com\/blog\/author\/rsahu4242_trysiteprice\/"}]}},"_links":{"self":[{"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/posts\/5693","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/comments?post=5693"}],"version-history":[{"count":1,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/posts\/5693\/revisions"}],"predecessor-version":[{"id":5698,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/posts\/5693\/revisions\/5698"}],"wp:attachment":[{"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/media?parent=5693"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/categories?post=5693"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/trysiteprice.com\/blog\/wp-json\/wp\/v2\/tags?post=5693"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}