Build a Samba Shared Server in Linux
Lab requirements:
Configure and access the Samba file sharing service, and configure the Access Users and corresponding permissions.
Tips: Create the shared directory/test and/share, and create the file tf1 (read-only) tf2 (read/write) under/test respectively. Create the file pf1 (read-only) under/share) and pf2 (read/write)
1. Mount the local yum Source
[Root @ localhost/] # mkdir/media/cdrom
[Root @ localhost/] # mount/dev/cdrom/media/cdrom/
[Root @ localhost/] # vim/etc/yum. repos. d/rhel-source.repo
Rhel-source]
Name = Red Hat Enterprise Linux $ releasever-$ basearch-Source
Baseurl = file: // media/cdrom
Enabled = 1
2. Disable Selinux and IPtables.
[Root @ localhost/] # vim/etc/selinux/config // path
[Root @ localhost/] # setenforce 0 // temporarily disable Selinux
[Root @ localhost/] #/etc/init. d/iptables stop // close the Firewall
3. Install the samba Service
[Root @ localhost/] # yum install samba-y
4. Create a shared user
[Root @ localhost/] # smbpasswd-a smb
[Root @ localhost/] # smbpasswd-a smb
5. modify the configuration file
[Root @ localhost/] # vim/etc/samba/smb. conf
Workgroup = WORKGROUP // Win needs to be changed to a Working Group
Server string = Samba Server Version % v
Security = user // you can change it 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 directory and File Permissions
[Root @ localhost/] # mkdir/test/share
[Root @ localhost/] # chown-R smb. smb/test // share/
[Root @ localhost test] # touch tp1 tp2
[Root @ localhost test] # chmod 444 tp1
[Root @ localhost test] # chmod 666 tp2
[Root @ localhost test] # echo "111">/test/tp1 // ceshi text
[Root @ localhost test] # echo "222">/test/tp2
[Root @ localhost test] # service smb restart // enable the service test
------------------------------------ Split line ------------------------------------
How to share files with Samba in Ubuntu 14.04
The speed of accessing samba from Ubuntu dual Nic of VMWare Virtual Machine doubles
Add the Samba File Sharing Server to the Windows Server 2003 Domain
Samba installation Configuration
Samba service configuration in CentOS 6.2
Samba Server installation and configuration
How to Build the Win7 + VMware + Fedora18 Samba Server
------------------------------------ Split line ------------------------------------
Samba details: click here
Samba: click here
This article permanently updates the link address: