佳木斯湛栽影视文化发展公司

主頁 > 知識庫 > centos7如何設置密碼規(guī)則?centos7設置密碼規(guī)則的方法

centos7如何設置密碼規(guī)則?centos7設置密碼規(guī)則的方法

熱門標簽:電話機器人搭建 外呼系統(tǒng) 美團 解決方案 百度競價點擊價格的計算公式 硅谷的囚徒呼叫中心 服務器配置 家政服務網絡

出于安全考慮設置密碼規(guī)則

設置密碼到期的天數。 
用戶必須在天內更改密碼。 
此設置僅影響創(chuàng)建用戶,而不會影響現有用戶。 
如果設置為現有用戶,請運行命令“chage -M(days)(user)”。
PASS_MAX_DAYS   60         # 密碼到期時間
PASS_MIN_DAYS   3          # 初始密碼更改時間
PASS_MIN_LEN    8          # 密碼最小長度
PASS_WARN_AGE   7          # 密碼過期提示時間

重復密碼限制使用

 [root@linuxprobe~]# vi /etc/pam.d/system-auth
# near line 15: prohibit to use the same password for 5 generation in past

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

設置最小密碼長度。 用戶不能設置小于此參數的密碼長度。

 # set 8 for minimum password length

[root@linuxprobe~]# authconfig --passminlen=8 --update
# the parameter is set in a config below

[root@linuxprobe~]# grep "^minlen" /etc/security/pwquality.conf
minlen = 8 

# 在新密碼中設置同一類的允許連續(xù)字符的最大數目
 # set 4 for maximum number of allowed consecutive characters of the same class

[root@linuxprobe~]# authconfig --passmaxclassrepeat=4 --update
# the parameter is set in a config below

[root@linuxprobe~]# grep "^maxclassrepeat" /etc/security/pwquality.conf
maxclassrepeat = 4 

# 在新密碼中至少需要一個小寫字符。
 [root@linuxprobe~]# authconfig --enablereqlower --update
# the parameter is set in a config below
# (if you'd like to edit the value, edit it with vi and others)

[root@linuxprobe~]# grep "^lcredit" /etc/security/pwquality.conf
lcredit = -1 

# 在新密碼中至少需要一個大寫字符
 [root@linuxprobe~]# authconfig --enablerequpper --update
# the parameter is set in a config below

# (if you'd like to edit the value, edit it with vi and others)
[root@linuxprobe~]# grep "^ucredit" /etc/security/pwquality.conf
ucredit = -1 

# 在新密碼中至少需要一個數字
 [root@linuxprobe~]# authconfig --enablereqdigit --update
# the parameter is set in a config below

# (if you'd like to edit the value, edit it with vi and others)
[root@linuxprobe~]# grep "^dcredit" /etc/security/pwquality.conf
dcredit = -1 

# 密碼包括至少一個特殊字符
 [root@linuxprobe~]# authconfig --enablereqother --update
# the parameter is set in a config below

# (if you'd like to edit the value, edit it with vi and others)
[root@linuxprobe~]# grep "^ocredit" /etc/security/pwquality.conf
ocredit = -1 

# 在新密碼中設置單調字符序列的最大長度。 (ex⇒'12345','fedcb')
 [root@linuxprobe~]# vi /etc/security/pwquality.conf
# add to the end
maxsequence = 3 

# 設置新密碼中不能出現在舊密碼中的字符數
 [root@linuxprobe~]# vi /etc/security/pwquality.conf
# add to the end
difok = 5 

# 檢查來自用戶passwd條目的GECOS字段的長度超過3個字符的字是否包含在新密碼中。
 [root@linuxprobe~]# vi /etc/security/pwquality.conf
# add to the end
gecoscheck = 1 

# 設置不能包含在密碼中的Ssace分隔的單詞列表
 [root@linuxprobe~]# vi /etc/security/pwquality.conf
# add to the end
badwords = denywords1 denywords2 denywords3 

# 為新密碼設置hash / crypt算法。 (默認為sha512)
# show current algorithm

[root@linuxprobe~]# authconfig --test | grep hashing

password hashing algorithm is md5
# chnage algorithm to sha512

[root@linuxprobe~]# authconfig --passalgo=sha512 --update
[root@linuxprobe~]# authconfig --test | grep hashing
password hashing algorithm is sha512 

標簽:南昌 韶關 烏蘭察布 邢臺 北海 臨沂 撫州 防城港

巨人網絡通訊聲明:本文標題《centos7如何設置密碼規(guī)則?centos7設置密碼規(guī)則的方法》,本文關鍵詞  ;如發(fā)現本文內容存在版權問題,煩請?zhí)峁┫嚓P信息告之我們,我們將及時溝通與處理。本站內容系統(tǒng)采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話咨詢

    • 400-1100-266
    吴江市| 宣威市| 克什克腾旗| 临西县| 乾安县| 南漳县| 全椒县| 天镇县| 安泽县| 晋州市| 金阳县| 琼海市| 托克逊县| 浮梁县| 达日县| 顺平县| 瑞昌市| 巴南区| 朔州市| 石首市| 荆州市| 长沙市| 贵港市| 揭西县| 武隆县| 宁乡县| 潮州市| 沈丘县| 南靖县| 射阳县| 贵定县| 武鸣县| 大安市| 安康市| 黔江区| 广灵县| 弥勒县| 和政县| 木兰县| 寿宁县| 九江县|