Experimental requirements:
Samba File Share service configuration and access, configure access to users, and appropriate permissions.
Tips: Create Shared directories/test and/share, and create files under/test TF1 (read-only) TF2 (read-write) under/share create file PF1 (read-only) and PF2 (read-write)
1. Mount Local Yum Source
[[email protected]/]# mkdir/media/cdrom[[email protected]/]# mount/dev/cdrom /media/cdrom/[[email protected]/]# Vim/etc/yum.repos.d/rhel-source.repo rhel-source]name=red Hat Enterprise Linux $releasever-$basearch-sourcebaseurl= File:///media/cdromenabled=1
2. Close SELinux and IPtables
[[email protected]/]# vim/etc/selinux/config //path [[email protected]/]# Setenforce 0 //temporary close Selinux[[email Protected]/]#/etc/init.d/iptables stop //Shut down firewall
3. Installing Samba Services
[email protected]/]# Yum install samba-y
4. Create a shared user
[[email protected]/]# smbpasswd-a smb[[email protected]/]# smbpasswd-a SMB
5. Modify the configuration file
[[email protected]/]# vim/etc/samba/smb.conf workgroup = Workgroup //win needs to be modified to workgroup Server string = Samba Server Version%v security = user //can be changed to everyone passdb backend = tdbsam[test] path =/test public = Yes writeable = yes valid users = smb[share] path =/share public = yes writeable = yes valid Users = SMB
6. Create local shared directories and file permissions
[[email protected]/]# mkdir/test/share[[email protected]/]# chown-r smb.smb/test//share/[[email protected] test]# t Ouch TP1 Tp2[[email protected] test]# chmod 444 TP1 [[email protected] test]# chmod 666 tp2[[email protected] test]# Echo "111" >/TEST/TP1 //ceshi text [[email protected] test]# echo "222" >/TEST/TP2
[[Email protected] test]# service SMB Restart//Open Services Test
Linux to build Samba shared server