Yum Install-y Samba Samba-client
Configure configuration files for SMB
Vim/etc/samba/smb.conf
Modify Workgroup=workgroup
Example 1 (share a directory, anyone can access it without entering a password, but requires read-only)
Change the security=user into a security=share.
[Test] (Shared directory: Note that this shared directory does not exist in Linux)
Comment=shar All (here is the description, whatever you write)
Path=/tmp/samba (This is the real access to the directory, it is best to set permissions 777)
Browseable=yes
Public=yes
Writable=no (Read only)
mkdir/tmp/samba/
Touch/tmp/samba/1.txt
Start/ETC/INIT.D/SMB Start
Browser input Fiel://ip/test
Example 2 (share a directory, need to use the account password to access, requirements can read and write)
Security=user
Here because Passdb Backend=tdbsam, so in the creation of virtual account and system account (two accounts, the system account must exist, in order to create a virtual account) to use the Pdbedit
[Test2]
Comment=share for users
Path=/tmp/samba
Browseable=yes
Writable=yes
Public=no
Mkdir/tmp/samba
chmod 777/tmp/samba
Create a System account
Useradd user1
Pdbedit-a user1
Note: pdbedit-l list accounts
Pdbedit-x Account Delete Account
Service SMB Start
File://ip/test2
Enter your account password
If you are a Linux user:
Smbclient//ip/test2/-U user1
The shared implementation can be mounted
Mount-t cifs/ip/test2/mnt/-O username=user1,password=123456
Df-h View
This post is self-taught experience, Master do not spray!
This article from the "Linux Learning Space" blog, reproduced please contact the author!
Samba builds Linux resources for sharing in Windows