(1) share a directory for all users to access, but the file can only be read-only mode
Installing Samba services: Yum install-y Samba samba-client
First: Edit the configuration file vim/etc/samba/smb.conf
Modified: Security = Share (default is user, first change to share mode)
Modify Workgroup (change to your computer's own workgroup): Workgroup = Workgroup
Then add a module to the last face:
[HJP]
Comment = Share all
Path =/tmp/sambadir
Browseable = yes is it possible to see it in our workgroup, which is the Network Neighborhood?
Public = yes
writable = no
Start the SMB service after modifying the configuration file:/ETC/INIT.D/SMB start
Finally create a folder to create a file for testing
A. How to log in to Samba under Windows: Start---> Run---> Input://192.168.109.130
B, Linux under How to login Samba:smbclient//192.168.109.130/hjp
C, Linux under How to attach this directory to this client server:
To install a service first: Yum install-y cifs-utils
Mount: Mount-t cifs//192.168.109.130/hjp/opt/
(2) share a directory to all users access, but to enter the user name password to access, the file is readable and writable
A, edit the configuration file: vim/etc/samba/smb.conf
Remove the Hjp module from the front of the mind first
Then change security = user again
Also add a section at the bottom:
[Hjplinux]
Comment = Share for users
Path =/tmp/sambadir
browseable = yes
writable = yes
public = No
And then save the exit
B. Create a Test account: Useradd smbuser1
Create Virtual account: Pdbedit-a Smbuser1
Restart Service:/ETC/INIT.D/SMB restart
C, Windows logon: Run---> Input: \\192.168.109.130\hjplinux
Linux Login: Smbclient-usmbuser1//192.168.109.130/hjplinux
D. Whether the test can be read and writable
This article is from the "7169431" blog, please be sure to keep this source http://7179431.blog.51cto.com/7169431/1877511
Samba deployment and optimization (sharing directories in our Linux system for download from Windows systems or other Linux servers, etc.)