新聞中心
:加強(qiáng)密碼策略和密碼管理

隨著互聯(lián)網(wǎng)普及,各種信息安全問題不斷涌現(xiàn)。密碼泄露事件頻頻發(fā)生,密碼復(fù)雜度成為阻擋黑客攻擊的首要屏障。但是,即便面對短而復(fù)雜的密碼,黑客仍可以使用強(qiáng)大的密碼破解工具進(jìn)行字典攻擊,從而抵消了復(fù)雜度的優(yōu)勢。?本文將提供密碼策略和密碼管理這兩個(gè)角度的解決辦法,幫助你更好地保護(hù)你的Linux系統(tǒng)。
1.加強(qiáng)密碼策略:延長密碼周期、加強(qiáng)密碼規(guī)則、引入密碼歷史
一個(gè)建議密碼周期為90天的Linux系統(tǒng),每隔90天強(qiáng)制用戶更改密碼。這樣可以防止黑客在長期內(nèi)使用舊密碼進(jìn)入系統(tǒng)。但是,如果密碼太短且缺乏復(fù)雜性,密碼更改頻率將不會(huì)起到保護(hù)安全的效果。因此,一種合適的密碼長度和復(fù)雜度應(yīng)該作為基本條件。如果你的Linux系統(tǒng)要求用戶輸入6位數(shù)字密碼,那么大約有100萬種可能性,但是,對于高速運(yùn)行的密碼破解程序而言,這樣的數(shù)字密碼幾乎要被瞬間破解。因此,建議密碼長度不少于10位,并且必須包含大寫字母、小寫字母、數(shù)字和特殊字符。這樣的密碼具有一定的熵值,黑客就難以通過暴力方法破解密碼。
為了有效防止用戶密碼過于“樸素”,我們再加強(qiáng)特殊規(guī)則,比如:必須至少使用8個(gè)以上字符,至少1個(gè)大寫字母、1個(gè)小寫字母、1個(gè)數(shù)字、1個(gè)特殊字符。此外,還可以規(guī)定密碼不能與用戶的其他信息,如姓名、賬號(hào)等相同。
引入密碼歷史是指不能重復(fù)使用密碼。在Linux系統(tǒng)中,可以設(shè)置密碼歷史次數(shù),即上一次密碼更換后,多久之內(nèi)用戶不能使用上一次密碼來登錄。這是為了避免用戶過于“懶散”而不更換密碼的情況。為了讓程序更加友好,程序可以設(shè)置“對特定用戶例外”,以便于與管理員、系統(tǒng)管理員等特殊角色的用戶使用而不會(huì)受到不必要的限制。
2.加強(qiáng)密碼管理:使用密碼管理工具和安全框架
鞏固密碼策略的同時(shí),加強(qiáng)密碼管理也是必不可少的。密碼管理工具可以在保證密碼安全性的同時(shí),提高用戶的使用效率??梢钥紤]選擇一些密碼管理工具或者使用集成環(huán)境(IDE),例如:LastPass、1Password、KeePassXC等。密碼管理工具可以生成隨機(jī)密碼,可以幫助用戶存儲(chǔ)密碼、保護(hù)密碼。如果遇到密碼遺失的情況,可以使用這些工具中的“找回密碼”功能,大致了解不能登錄的密碼。同時(shí),密碼管理工具也可以對用戶密碼進(jìn)行強(qiáng)度的評估,幫助用戶了解是否符合管理規(guī)則。
與此同時(shí),也可以使用安全框架來增強(qiáng)密碼安全性。例如使用多因素認(rèn)證(MFA)來加強(qiáng)登錄安全性。MFA需要用戶輸入密碼和其他識(shí)別因素(例如,安全令牌碼、指紋、面部識(shí)別等)來通過認(rèn)證。由于識(shí)別因素存在組合和隨機(jī)性,因此MFA可以在一定程度上防止黑客利用假密碼登錄系統(tǒng)。還可以使用單點(diǎn)登錄(SSO)來降低密碼管理壓力。在SSO上,用戶只需要一次登錄,就可以訪問多個(gè)應(yīng)用程序。這種方法可以降低管理成本并提高安全性。
結(jié)論
為了防止黑客攻擊,我們需要建立合理的密碼策略和密碼管理機(jī)制。密碼策略的優(yōu)化主要集中在密碼長度、復(fù)雜度、密碼周期、密碼規(guī)則等方面。密碼管理建議使用密碼管理工具,加強(qiáng)MFA,使用SSO機(jī)制等。
應(yīng)該注意,上述建議應(yīng)根據(jù)不同Linux系統(tǒng)的具體情況進(jìn)行調(diào)整,以保證密碼安全策略的可行性。只有建立完整的密碼安全體系,在互聯(lián)網(wǎng)安全日漸嚴(yán)格的情況下,才能保證服務(wù)器的安全和敏感數(shù)據(jù)的安全。
相關(guān)問題拓展閱讀:
- linux如何設(shè)置一般用戶密碼必須達(dá)到一定強(qiáng)度?還有3月強(qiáng)制更改一次密碼
linux如何設(shè)置一般用戶密碼必須達(dá)到一定強(qiáng)度?還有3月強(qiáng)制更改一次密碼
密碼復(fù)雜度在
# vim /etc/pam.d/system-auth里
找到password requisite pam_cracklib.so在后面可以加 difok=x(要x個(gè)不同字符) minlen=x(最小密碼長度) ucredit=-x(最少x個(gè)大寫字母) lcredit=-x(最少x個(gè)小寫字母) dcredit=-x (最少x個(gè)數(shù)字)dictpath=/usr/share/cracklib/pw_dict
時(shí)間在
# vim /etc/login.defs
PASS_MAX_DAYS(更大什么時(shí)候過期)
PASS_MIN_DAYS (最小什么事后過期)
PASS_MIN_LEN (密碼最小長度)
PASS_WARN_AGE (警告天數(shù))
我們在使用linux系統(tǒng)設(shè)置密碼的時(shí)候,經(jīng)常遇到這樣的問題,系統(tǒng)提示:您的密碼太簡單,或者您的密碼是字典的一部分。那么系統(tǒng)是如何實(shí)現(xiàn)對用戶的密碼的復(fù)雜度的檢查的呢?
系統(tǒng)對密碼的控制是有兩部分(我知道的)組成:
1 cracklib
2 login.defs
聲明:login.defs主要是控制密碼的有效期。對密碼進(jìn)行時(shí)間管理。此處不細(xì)談
login.defs –shadow password suite configuration
pam_cracklib.so 才是控制密碼復(fù)雜度的關(guān)鍵文件
redhat公司專門開發(fā)了cracklib這個(gè)安裝包來判斷密碼的復(fù)雜度
可以rpm -ql cracklib查看
密碼的復(fù)雜度的判斷是通過pam模塊控制來實(shí)現(xiàn)的,具體的模塊是pam_cracklibpam_cracklib 的參數(shù)介紹:
debug
This option makes the module write information to syslog(3) indicating the behavior of the module (this option does not write password information to the log file).
type=XXX
The default action is for the module to use the following prompts when requesting passwords: “New UNIX password: ” and “Retype UNIX password: “. The default word UNIX can be replaced with this option.
retry=N
Prompt user at most N times before returning with error. The default is 1
difok=N
This argument will change the default of 5 for the number of characters in the new password that must not be present in the old password. In addition, if 1/2 of the characters in the new password are different then the new password will be accepted anyway.
difignore=N
How many characters should the password have before difok will be ignored. The default is 23.
minlen=N
The minimum acceptable size for the new password (plus one if credits are not disabled which is the default). In addition to the number of characters in the new password, credit (of +1 in length) is given for each different kind of character (other, upper, lower and digit). The default for this parameter is 9 which is good for a old style UNIX password all of the same type of character but may be too low to exploit the added security of a md5 system. Note that there is a pair of length limits in Cracklib itself, a “way too short” limit of 4 which is hard coded in and a defined limit (6) that will be checked without reference to minlen. If you want to allow passwords as short as 5 characters you should not use this module.
dcredit=N
(N >= 0) This is the maximum credit for having digits in the new password. If you have less than or N digits, each digit will count +1 towards meeting the current minlen value. The default for dcredit is 1 which is the recommended value for minlen less than 10.
(N = 0) This is the maximum credit for having upper case letters in the new password. If you have less than or N upper case letters each letter will count +1 towards meeting the current minlen value. The default for ucredit is 1 which is the recommended value for minlen less than 10.
(N > 0) This is the minimum number of upper case letters that must be met for a new password.
lcredit=N
(N >= 0) This is the maximum credit for having lower case letters in the new password. If you have less than or N lower case letters, each letter will count +1 towards meeting the current minlen value. The default for lcredit is 1 which is the recommended value for minlen less than 10.
(N = 0) This is the maximum credit for having other characters in the new password. If you have less than or N other characters, each character will count +1 towards meeting the current minlen value. The default for ocredit is 1 which is the recommended value for minlen less than 10.
(N
use_authtok
This argument is used to force the module to not prompt the user for a new password but use the one provided by the previously stacked password module.
dictpath=/path/to/dict
Path to the cracklib dictionaries.
dictpath=/path/to/dict //注:密碼字典,這個(gè)是驗(yàn)證用戶的密碼是否是字典一部分的關(guān)鍵。
Path to the cracklib dictionaries.
cracklib密碼強(qiáng)度檢測過程
首先檢查密碼是否是字典的一部分,如果不是,則進(jìn)行下面的檢查
密碼強(qiáng)度檢測過程
These checks are:
Palindrome
Is the new password a palindrome of the old one?
新密碼是否舊密碼的回文
Case Change Only
Is the new password the the old one with only a change of case?
新密碼是否只是就密碼改變了大小寫
Similar
Is the new password too much like the old one?
新密碼是否和舊密碼很相似
This is primarily controlled by one argument, difok which is a number of characters that if different between the old and new are enough to accept the new password, this defaults to 10 or 1/2 the size of the new password whichever is aller.
To avoid the lockup associated with trying to change a long and complicated password, difignore is available. This argument can be used to specify the minimum length a new password needs to be before the difok value is ignored. The default value for difignore is 23.
Simple
Is the new password too all?
新密碼是否太短
This is controlled by 5 arguments minlen, dcredit, ucredit, lcredit, and ocredit. See the section on the arguments for the details of how these work and there defaults.
Rotated
Is the new password a rotated version of the old password?
新密碼的字符是否是舊密碼字符的一個(gè)循環(huán)
例如舊密碼:123
新密碼:231
Already used
Was the password used in the past?
這個(gè)密碼以前是否使用過
Previously used passwords are to be found in /etc/security/opasswd.
那么系統(tǒng)是如何實(shí)現(xiàn)這個(gè)控制的呢?
在系統(tǒng)的配置文件/etc/pam.d/system-auth 中有這樣一行
password requisite pam_cracklib.so try_first_pass retry=3
我們可以根據(jù)pam_cracklib的參數(shù)這樣配置這個(gè)pam模塊來達(dá)到我們想要的目的
關(guān)于linux密碼滿足復(fù)雜性要求的介紹到此就結(jié)束了,不知道你從中找到你需要的信息了嗎 ?如果你還想了解更多這方面的信息,記得收藏關(guān)注本站。
創(chuàng)新互聯(lián)服務(wù)器托管擁有成都T3+級(jí)標(biāo)準(zhǔn)機(jī)房資源,具備完善的安防設(shè)施、三線及BGP網(wǎng)絡(luò)接入帶寬達(dá)10T,機(jī)柜接入千兆交換機(jī),能夠有效保證服務(wù)器托管業(yè)務(wù)安全、可靠、穩(wěn)定、高效運(yùn)行;創(chuàng)新互聯(lián)專注于成都服務(wù)器托管租用十余年,得到成都等地區(qū)行業(yè)客戶的一致認(rèn)可。
當(dāng)前題目:如何使Linux密碼更加安全滿足復(fù)雜性要求(linux密碼滿足復(fù)雜性要求)
文章分享:http://www.dlmjj.cn/article/djggodd.html


咨詢
建站咨詢
