Ansible 批量管理使用者口令策略

2021-09-25 11:26:25 字數 498 閱讀 4530

批量設定linux 使用者口令過期日間,步驟如下:

1、使用ansible shell模組將遠端client端系統中的使用者名稱取出存放至本地/tmp目錄(注意:shell模組中元字元需使用「 \ 」轉義)

2、使用ansible script模組執行ansible本地指令碼在client端執行,修改使用者密碼過期策略(注意chuser.sh指令碼在ansible中,username.txt在遠端client中)

ansible all -m shell -a "cat /etc/passwd|awk -f: ''>/tmp/username.txt"

ansible all -m script -a "/etc/ansible/chuser.sh"

/etc/ansible/chuser.sh內容:

#!/bin/bash

cat /tmp/username.txt | while read name ;do

chage -m 90 $name

done

使用profile管理使用者口令

使用profile管理使用者口令 profile是口令限制,資源限制的命令集合,當建立資料庫時,oralce會自動建立名稱為default的profile,當建立使用者沒有指定profile選項,oracle會將default分配給使用者。1 賬戶鎖定 指定該賬戶或使用者登入時最多可以輸入密碼的次數...

Oracle使用者口令

password life time 60 口令的生命週期,超過這段時間口令可能會自動過期,是否過期要看是否設定了password grace time password grace time 10 接著password life time特性,如果password life time的期限已到,那...

SCO UNIX 系統管理 使用者 口令

使用者管理 1 增加和取消使用者 scoadmin account 比如 新增乙個使用者suhua,你可以 scoadmin account user add new user 你就可以添 加使用者suhua了,祝你好運,呵呵!2 改變使用者 su 比如 你是使用者suhua,現在改變為使用者deh...