centos伺服器密碼規則自訂

來源:互聯網
上載者:User

標籤:

 

隨著linux使用的普遍,對於linux使用者以及系統的安全要求越來越高,而使用者密碼複雜程度是系統安全性高低的首要體現。
因此如何對linux下使用者的密碼進行規則限制,以保證使用者必須使用複雜的密碼,杜絕使用者隨意使用簡單的密碼,從而提高使用者的安全性和系統的安全性。


要想修改伺服器預設的密碼規則,需要修改/etc/pam.d/system-auth檔案
如下:
修改/etc/pam.d/system-auth檔案,將檔案中的

password requisite pam_cracklib.so try_first_pass retry=3

password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok

修改為:

password requisite pam_cracklib.so try_first_pass retry=3 minlen=8 ucredit=-2 lcredit=-4 dcredit=-1 ocredit=-1

password sufficient pam_unix.so md5 shadow nullok try_first_pass use_authtok remember=5


以上修改參數分別說明設定密碼的時候要遵循下面的規則:

minlen=8 最小密碼長度為8位
ucredit=-2 最少有2個大寫字母
lcredit=-4 最少4個小寫字元
dcredit=-1 最少1個數字
ocredit=-1 最少1個符號
remember=5 密碼最近5次的不能重用

 

這樣,按照自訂的規則設定密碼,在安全登入方面會有所提升!

centos伺服器密碼規則自訂

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.