OpenLDAP认证及autofs
2.安装migrationtools并配置迁移域
yum -y install migrationtools
ldapadd -x -c -D
ldapadd -x -c -D
ldapadd -x -c -D
echo '/opt/ldapusers 192.168.8.0/24(rw,sync)' >>/etc/exports
systemctl restart nfs
systemctl enable nfs-server
yum -y install nss-pam-ldapd
echo '/opt/ldapusers /etc/auto.openldap' >>/etc/auto.master
echo '* -rw,soft,intr 192.168.8.254:/opt/ldapusers/&' >>/etc/auto.openldap
systemctl restart autofs
[root@metaq01 ~]#
root:x:0:0:root:/root:/bin/bash
... ...
nfsnobody:x:65534:65534:Anonymous NFS User:/var/lib/nfs:/sbin/nologin
foo1:x:1006:1006:foo1:/opt/ldapusers/foo1:/bin/bash
foo2:x:1007:1007:foo2:/opt/ldapusers/foo2:/bin/bash
foo3:x:1008:1008:foo3:/opt/ldapusers/foo3:/bin/bash
foo4:x:1009:1009:foo4:/opt/ldapusers/foo4:/bin/bash
foo5:x:1010:1010:foo5:/opt/ldapusers/foo5:/bin/bash
foo6:x:1011:1011:foo6:/opt/ldapusers/foo6:/bin/bash
foo7:x:1012:1012:foo7:/opt/ldapusers/foo7:/bin/bash
foo8:x:1013:1013:foo8:/opt/ldapusers/foo8:/bin/bash
foo9:x:1014:1014:foo9:/opt/ldapusers/foo9:/bin/bash
foo10:x:1015:1015:foo10:/opt/ldapusers/foo10:/bin/bash
foo11:x:1016:1016:foo11:/opt/ldapusers/foo11:/bin/bash
foo12:x:1017:1017:foo12:/opt/ldapusers/foo12:/bin/bash
foo13:x:1018:1018:foo13:/opt/ldapusers/foo13:/bin/bash
foo14:x:1019:1019:foo14:/opt/ldapusers/foo14:/bin/bash
foo15:x:1020:1020:foo15:/opt/ldapusers/foo15:/bin/bash
[root@metaq01 ~]# su - foo8
[foo8@metaq01 ~]$ logout
[root@metaq01 ~]# su - foo12
[foo12@metaq01 ~]$ logout
[root@metaq01 ~]# su - foo3
[foo3@metaq01 ~]$ pwd
/opt/ldapusers/foo3
[foo3@metaq01 ~]$ mount
proc on /proc type proc (rw,nosuid,nodev,noexec,relatime)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec,relatime,seclabel)
devtmpfs on /dev type devtmpfs (rw,nosuid,seclabel,size=732784k,nr_inodes=183196,mode=755)
devpts on /dev/pts type devpts (rw,nosuid,noexec,relatime,seclabel,gid=5,mode=620,ptmxmode=000)
tmpfs on /run type tmpfs (rw,nosuid,nodev,seclabel,size=742424k,nr_inodes=185606,mode=755)
tmpfs on /sys/fs/cgroup type tmpfs (ro,nosuid,nodev,noexec,seclabel,size=742424k,nr_inodes=185606,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup (rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
/dev/mapper/vg0-root on / type xfs (rw,relatime,seclabel,attr2,inode64,noquota)
/etc/auto.misc on /misc type autofs (rw,relatime,fd=6,pgrp=2731,timeout=300,minproto=5,maxproto=5,indirect)
-hosts on /net type autofs (rw,relatime,fd=12,pgrp=2731,timeout=300,minproto=5,maxproto=5,indirect)
/etc/auto.openldap on /opt/ldapusers type autofs (rw,relatime,fd=18,pgrp=2731,timeout=300,minproto=5,maxproto=5,indirect)
192.168.8.254:/opt/ldapusers/foo3 on /opt/ldapusers/foo3 type nfs4 (rw,relatime,vers=4.0,rsize=1048576,wsize=1048576,namlen=255,soft,proto=tcp,port=0,timeo=600,retrans=2,sec=sys,clientaddr=192.168.8.101,local_lock=none,addr=192.168.8.254)