Samba foundation to build

Markdown written documentation showing structures may be a problem

Samba can be set up to develop the environment and code on servers, easy to modify development,
#### Samba build
> Server: System: CentOS 7
> Computer: Mac
#### Server:
Install samba
`yum -y install samba samba-client samba-common`
Create a samba user login user name of testUser
`useradd -s /sbin/nologin testUser`
Set testUser user password (recommended case plus numbers plus special symbols)
`smbpasswd -a testUser`
Modify the configuration file
`vim /etc/samba/smb.conf`
```
[Global] # This is the global configuration, will be written section
  workgroup = MYGROUP # Working Group, to take a name
  server string = Samba Server Version% v # Samba server description, can be customized
  log file = /var/log/samba/log.%m
  max log size = 50
  security = user # security level operation, as well as share authentication
  passdb backend = tdbsam # account passwords are stored in the form of data files
  load printers = yes
  cups options = raw
[Homes] # user's home directory common share, each user can have full access to their home directory
  comment = Home Directories # shared resources Description
  browseable = no # whether the browser can be
  writable = yes # writable
  [Printers] # with printer-related options
  comment = All Printers
  path = /var/spool/samba
  browseable = no
  guest ok = no # Anonymous users can log
  writable = no
  printable = yes
[Linuxdir] # custom shared directory;
path = / data # data set shared directory
whether writeable = yes # write, here I writable; yes / no
browseable = no # whether the browser; yes / no
guest ok = no # whether anonymous users to log in; yes / no
valid users = testUser # users and groups allowed to access    
write list = testUser # allow the user to write
read list = all # users read-only
create mode = 0344 # control the new file permissions
force create mode = 0344 # control the new file permissions
directory mode = 077 # The new directory permissions control
force directory mode = 0777 # control of the new directory permissions
hosts deny = all # prohibit access to the client
hosts allow = all # allow access to clients
```
Open the file permissions
`chmod -R 777 /data`
Add a firewall
`firewall-cmd --permanent --zone=public --add-service=samba`
`sudo firewall-cmd --reload`
Set boot
`systemctl enable smb.service`
`systemctl enable nmb.service`
Restart samba
`/sbin/service smb restart `
or
`systemctl restart smb.service`
#### PC connection
Go to open the file server connection

 

Add Server:

 

Enter the user name and password to create a successful connection:

 

After all of the development environment, code on the server; 

Guess you like

Origin www.cnblogs.com/Ferdinand-B/p/11420042.html