RH124: 上完 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
RH134: 上完 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
RH254: 上完 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
nfs+autofs+kerberos+selinux:
/etc/auto.guests:
- #
- # This is an automounter map and it has the following format
- # key [ -mount-options-separated-by-comma ] location
- # Details may be found in the autofs(5) manpage
- #cd -fstype=iso9660,ro,nosuid,nodev :/dev/cdrom
- * -rw,sec=krb5p,v4.2,soft,intr,context="unconfined_u:object_r:public_content_t:s0" 192.168.0.103:/rhosts/&
- # the following entries are samples to pique your imagination
- #linux -ro,soft,intr ftp.example.org:/pub/linux
- #boot -fstype=ext2 :/dev/hda1
- #floppy -fstype=auto :/dev/fd0
- #floppy -fstype=ext2 :/dev/fd0
- #e2floppy -fstype=ext2 :/dev/fd0
- #jaz -fstype=ext2 :/dev/sdc1
- #removable -fstype=ext2 :/dev/hdd
- ~
复制代码 实验的过程:
- [root@desktop3 ~]# ssh ldapuser1@desktop3.example.com
- ldapuser1@desktop3.example.com's password:
- Last login: Wed Sep 11 10:03:34 2019 from desktop3.example.com
- [ldapuser1@desktop3 ~]$ ls -Zd
- drwx------. ldapuser1 ldapuser1 unconfined_u:object_r:public_content_t:s0 .
- [ldapuser1@desktop3 ~]$ ls
- 6 7
- [ldapuser1@desktop3 ~]$ touch 8
- [ldapuser1@desktop3 ~]$ ls -Z
- -rw-r--r--. root root unconfined_u:object_r:public_content_t:s0 6
- -rw-rw-r--. ldapuser1 ldapuser1 unconfined_u:object_r:public_content_t:s0 7
- -rw-rw-r--. ldapuser1 ldapuser1 unconfined_u:object_r:public_content_t:s0 8
复制代码
-------
多用户samba挂载:
在server3上:
- [root@server3 sharedir]# useradd wang5
- [root@server3 sharedir]# smbpasswd -a wang5
- New SMB password:
- Retype new SMB password:
- Added user wang5.
复制代码 在desktop3上:
/etc/fstab:
- /dev/mapper/rhel-root / xfs defaults 0 0
- UUID=cae2eaaa-59ea-4c63-9c87-8e5358b6d9ac /boot xfs defaults 0 0
- /dev/mapper/rhel-swap swap swap defaults 0 0
- //192.168.0.103/sharedir /mnt2 cifs defaults,username=wang5,password=wang5samba,multiuser,sec=ntlmssp 0 0
- ~
复制代码 mount -a
(不建用户wang5,guest也可以)
-------------
- [root@desktop3 ~]# cd /mnt2
- ls
- [root@desktop3 mnt2]# ls
- li4.txt zhang3.txt
- [root@desktop3 mnt2]# ls
- li4.txt zhang3.txt
- [root@desktop3 mnt2]# touch 6=
- touch: cannot touch ‘6=’: Permission denied
- [root@desktop3 mnt2]# touch 6
- touch: cannot touch ‘6’: Permission denied
- [root@desktop3 mnt2]# su - zhang3
- Last login: Wed Sep 11 11:11:15 CST 2019 on pts/1
- [zhang3@desktop3 ~]$ cd /mnt2
- [zhang3@desktop3 mnt2]$ ls
- ls: reading directory .: Permission denied
- [zhang3@desktop3 mnt2]$ cifscreds add 192.168.0.103
- Password:
- [zhang3@desktop3 mnt2]$ ls
- li4.txt zhang3.txt
- [zhang3@desktop3 mnt2]$ echo "zhang3-2" >>zhang3.txt
- [zhang3@desktop3 mnt2]$
复制代码 由于只看用户名(而NFS要看真的uid), 所以本地的某一个test用户,也能够使用multiuser
- [test@desktop3 mnt2]$ cifscreds add -u zhang3 192.168.0.103
- Password:
- [test@desktop3 mnt2]$ ls
- li4.txt zhang3.txt
- [test@desktop3 mnt2]$ echo "zhang3-3" >> zhang3.txt
复制代码
|