歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
Linux教程網 >> Linux綜合 >> Linux資訊 >> 更多Linux >> PAM中的模塊

PAM中的模塊

日期:2017/2/27 14:15:19   编辑:更多Linux
  模塊導引, 這裡對最常用的10個模塊做了描述. 想知道更多的信息, 你可以察看/usr/doc/pam* 下的文件. 1) Chroot pam_chroot Management groups provided: account; session; authentication 為用戶提供了一偽造的文件系統. 2) Cracklib pluggable passWord strength-checker pam_cracklib Management groups provided: password 需要庫libcrack 和議本系統字典/usr/lib/cracklib_dict. 檢查密碼的可靠性 對下列問題進行檢查: Palindrome - 回文 速度和倒讀都一樣 Case Change Only - 僅僅是大小寫的變化 Similar - 過於相似 Simple - 太簡單了 Rotated - 是舊密碼的循環 Password component 可識別的參數 debug; type=XXX; retry=N; difok=N; minlen=N; dcredit=N; UCredit=N; lcredit=N; ocredit=N; Description: 提示用戶輸入密碼,並檢查密碼是否可靠. debug - 透過syslogd來寫信息. type=XXX - 系統的名字 retry=N - 可重試的次數 difok=N - 至少要有多少個字符不同 minlen=N - 新密碼的長度加一的最小值 dcredit=N ucredit=N lcredit=N ocredit=N - 最少要有多少的數字,大寫字母,小寫字母和其它字母. 3) Deny pam_deny Management groups provided: account; authentication; password; session 用於拒絕提供服務. Account component 僅僅是返回一個錯誤 PAM_ACCT_EXPIRED. # # add this line to your other login entries to disable all accounts # login account required pam_deny.so Authentication component 僅僅是返回一個錯誤 PAM_AUTH_ERR. 當調用 pam_authenticate()時. 返回 PAM_CRED_UNAVAIL, 當調用 pam_setcred() 時. # # add this line to your existing OTHER entries to prevent # authentication succeeding with default applications. # OTHER auth required pam_deny.so Password component Recognized arguments: Description: 拒絕用戶修改密碼.返回PAM_AUTHTOK_ERR. Examples/suggested usage: # # add this line to your other login entries to prevent the login # application from being able to change the user's password. # login password required pam_deny.so Session component 阻止用戶在主機上開始一個session. Examples/suggested usage: # # An example to see how to configure login to refuse the user a


# session (politely) # login session required pam_motd.so file=/etc/system_time login session required pam_deny.so 4) Anonymous Access module pam_FTP.so Management groups provided: authentication Overview of module 提供了匿名ftp認證. Authentication component 參數: debug; users=XXX,YYY,...; ignore 丹用戶名為ftp或anonymous時,將密碼安@分為 PAM_RUSER 和 PAM_RHOST; 相應的設置pam-items. 用戶名被設為 ftp. debug - syslog users=XXX,YYY,...- 允許的用戶名. ignore - 不關心用戶的email地址. The group access module pam_group Management groups provided: authentication System dependencies: 需要設置 /etc/security/group.conf Network aware: 需要正確設置PAM_TTY item. Overview of module 基於用戶名和它們使用的終端來決定是否提供服務. Authentication component 5) The last login module pam_lastlog Management groups provided: auth System dependencies: 所用的信息包含在/var/log/wtmp中. Overview of module 這個模塊維護 /var/log/wtmp . 增加打開的一項當調用 pam_open_seesion() 當pam_close_session()時關閉該項.它也顯示一條信息表示用戶上次何時登陸. ``Last login on ...'' 該模塊維護 /var/log/wtmp. Authentication component Recognized arguments: debug; nodate; noterm; nohost; silent; never Description: debug - write more information to syslog(3). nodate - 不顯示上次登陸的時間 noterm - 不顯示上次登陸的終端. nohost - 不顯示上次登陸的主機. silent - 不顯示上次登陸的信息,值更新 /var/log/wtmp. never - 如果/var/log/wtmp 不包含上次登陸的信息. 顯示``welcome..." Examples/suggested usage: 這個木塊可以用來顯示該用戶收到了new mail,當它們登陸到系統中時. # # do we have any mail? # login session optional pam_lastlog.so 6) The resource limits module pam_limits Management groups provided: session /etc/security/limits.conf內核支持 resource limits. Overview of module 通過 Linux-PAM open-session hook 設置用戶的session可使用的系統資源上限 Session component Recognized arguments: debug; conf=/path/to/file.conf

root不受限制 conf=/path/to/file.conf 指定替代缺省的配置文件的文件名 例如: 為了使用這個模塊 /etc/security/limits.conf 必須是root只讀的 <domain> <type> <item> <value> The fields listed above should be filled as follows... <domain> 可以是用戶名,用戶組名(@group) 或統配符 * 表示缺省規則 <type> 可以是 hard soft hard 強制實行 由管理員設置 由Linux Kernel執行 . 用戶無權改變. soft 非強制執行. 用戶可以改變 在之前存在的 hard limits 允許下. <item> 可以是下列值: core - core 文件的大小 (KB) data - 最大的data大小 (KB) fsize - maximum filesize (KB) memlock - max locked-in-memory address space (KB) nofile - max number of open files rss - max resident set size (KB) stack - max stack size (KB) cpu - max CPU time (MIN) nproc - max number of processes as - address space limit maxlogins - max number of logins for this user. 通過加一個(-)來完全取消限制 (Example: ``bin -'', ``@admin -''). 注意用戶的優先級比組的優先級要高. 下面是一個例子: # EXAMPLE /etc/security/limits.conf file: # ======================================= # <domain> <type> <item> <value> * soft core 0 * hard rss 10000 @student hard nproc 20 @faculty soft nproc 20 @faculty hard nproc 50 ftp hard nproc 0 @student - maxlogins 4 7) The no-login module pam_nologin Management groups provided: authentication Overview of module 提供了標准的unix nologin服務. Authentication component Recognized arguments: Description: 當/etc/nologin文件存在時就拒絕login. 8) The Password-Database module pam_pwdb Management groups provided: account; authentication; password; session Overview of module 用於取代 pam_unix_* 模塊. 它使用了通用的 Password Database library 接口函數. Account component Recognized arguments: debug 例如: /etc/pam.d/login 一定會有下面一行. # # Ensure users account and password are still active # login account required pam_pwdb.so Authentication component 可用的闡述: debug; use_first_pass; try_first_pass; nullok; nod



pam_nologin Management groups provided: authentication Overview of module 提供了標准的unix nologin服務. Authentication component Recognized arguments: Description: 當/etc/nologin文件存在時就拒絕login. 8) The Password-Database module pam_pwdb Management groups provided: account; authentication; password; session Overview of module 用於取代 pam_unix_* 模塊. 它使用了通用的 Password Database library 接口函數. Account component Recognized arguments: debug 例如: /etc/pam.d/login 一定會有下面一行. # # Ensure users account and password are still active # login account required pam_pwdb.so Authentication component 可用的闡述: debug; use_first_pass; try_first_pass; nullok; nod



Overview of module 用於取代 pam_unix_* 模塊. 它使用了通用的 Password Database library 接口函數. Account component Recognized arguments: debug 例如: /etc/pam.d/login 一定會有下面一行. # # Ensure users account and password are still active # login account required pam_pwdb.so Authentication component 可用的闡述: debug; use_first_pass; try_first_pass; nullok; nod



Copyright © Linux教程網 All Rights Reserved