当前位置 : 主页 > 操作系统 > centos >

pam_env.so

来源:互联网 收集:自由互联 发布时间:2022-06-20
OS version:Red Hat Enterprise Linux Server release 6.4 Kernel version:2.6.32-358.el6.x86_64 ------------------------------------------------------------------------- 准备工作: [root@Zhai ~]# env | grep pam_env_test1 [root@Zhai ~]#




OS version:Red Hat Enterprise Linux Server release 6.4
Kernel version:2.6.32-358.el6.x86_64


-------------------------------------------------------------------------


准备工作:


[root@Zhai ~]# env | grep pam_env_test1
[root@Zhai ~]# env | grep pam_env_test2
[root@Zhai ~]# env | grep pam_env_test3
[root@Zhai ~]# env | grep pam_env_test4
[root@Zhai ~]# su - pam_test1
[pam_test1@Zhai ~]$ env | grep pam_env_test1
[pam_test1@Zhai ~]$ env | grep pam_env_test2
[pam_test1@Zhai ~]$ env | grep pam_env_test3
[pam_test1@Zhai ~]$ env | grep pam_env_test4




验证1:


[root@Zhai ~]# vi /etc/pam.d/su

#%PAM-1.0 auth required pam_unix.so account required pam_unix.so session required pam_env.so conffile=/etc/security/pam_env.conf


[root@Zhai ~]# vi /etc/security/pam_env.conf

pam_env_test1 DEFAULT=Zhai_kang pam_env_test2 DEFAULT="Zhai_kang 2013" pam_env_test3 DEFAULT="Zhai_kang 201311" OVERRIDE=${pam_env_test1} pam_env_test4 DEFAULT=zhai_kang:201311\ 17,19:30:00


pam_env.so_安全





验证2:


[root@Zhai ~]# cat /etc/security/pam_env.conf

pam_env_test1 DEFAULT=Zhai_kang pam_env_test2 DEFAULT="Zhai_kang 2013" pam_env_test3 DEFAULT="Zhai_kang 201311" OVERRIDE=${pam_env_test1} pam_env_test4 DEFAULT=zhai_kang:201311\ 17,19:30:00


[root@Zhai ~]# vi /etc/environment

pam_env_test4="----Zhai_kang V----" pam_test5="Kang_Zhai 2013"


[root@Zhai ~]# vi /etc/pam.d/su

#%PAM-1.0 auth required pam_unix.so account required pam_unix.so session required pam_env.so conffile=/etc/security/pam_env.conf envfile=/etc/environment readenv=1


pam_env.so_安全_02





验证3:


[root@Zhai ~]# cat /etc/security/pam_env.conf

pam_env_test1 DEFAULT=Zhai_kang pam_env_test2 DEFAULT="Zhai_kang 2013" pam_env_test3 DEFAULT="Zhai_kang 201311" OVERRIDE=${pam_env_test1} pam_env_test4 DEFAULT=zhai_kang:201311\ 17,19:30:00


[root@Zhai ~]# cat /etc/environment

pam_env_test4="----Zhai_kang V----" pam_test5="Kang_Zhai 2013"


[root@Zhai ~]# vi /etc/pam.d/su

#%PAM-1.0 auth required pam_unix.so account required pam_unix.so session required pam_env.so conffile=/etc/security/pam_env.conf envfile=/etc/environment readenv=1 user_envfile=.pam_environment user_readenv=1


[pam_test1@Zhai ~]$ vi .pam_environment

pam_env_test1=------20131127-21:13:00------------- pam_env_test4=----vvv-vvvV---- pam_test=----vvv----


pam_env.so_Linux-PAM_03




-------------------------------------------------------------------------


The detailed information:man pam_env
The detailed information:man pam_env.conf




网友评论