It is very useful for us to realize that Samba can share files with Linux and Windows machines. Here are a few practices to learn about Samba, note: Before you practice, check if Selinux is off or it might not be successful.
Practice 1
Requirements: Share a directory, anyone can access, that is, without entering a password to access, require read-only
Open the Samba configuration file in the [Global] section
Vim/etc/samba/smb.conf
Change to Security = Share
Change to Workgroup = Workgroup
Then add the following at the very end of the file:
==/tmp/= Yes public == no
The shared name is Wangshaojun.
Comment Share All
Location of path shared directory
Browseble whether the workgroup is allowed to see
Public is open
Whether writable can be written
Start Samba
/ETC/INIT.D/SMB start
To create a shared directory
Mkdir/tmp/sambadir
Write something in there.
cp/etc/passwd/tmp/sambadir/1. txt
Create a directory, authorize 777. Normal can be created, because the configuration is forbidden to write, verify whether writable
Mkdir/tmp/sambadir/test
777 !$
Test, how to access the share
Under Windows, click Start-run
Creation is not allowed.
Access under Linux
Input command
// 192.168.1.117/wangshaojun
Prompt to enter a password. Direct return
There is another way to mount it.
Installing Mount-related
Yum Install-y cifs-utils
Mount
// 192.168.1.117/wangshaojun/opt/
View
Df-h
192.168.1.117/wangshaojun 18G 3.6G 14G 21%/opt
has been mounted under opt
LS view file under opt directory
Ls/opt
Deploy and tune 1.8 Samba deployment and optimization-2