用户名:d伪装d 文章数:40 评论数:6
访问量:5192:4952:484:3 注册日期:2011-02-25
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
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\ |
验证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\ |
[root@Zhai ~]# vi /etc/environment
pam_env_test4= "----Zhai_kang V----" pam_test5= "Kang_Zhai 2013" |
[root@Zhai ~]# vi /etc/pam.d/su
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 |
验证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\ |
[root@Zhai ~]# cat /etc/environment
pam_env_test4= "----Zhai_kang V----" pam_test5= "Kang_Zhai 2013" |
[root@Zhai ~]# vi /etc/pam.d/su
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
没有评论:
发表评论