Linux services of Samba Service article

Samba service Samba Smb is based cs architecture

Role: for cross-platform file sharing

Pros: Good compatibility, safer

Cons: Only within the network environments

Applications: general use in office environments

First, to achieve single-user file sharing

step:

1 , the installation

# yum -y install samba

2 , configuration (love would suit) (available by default, does not require configuration)

# yum /etc/samba/smb.conf

3 , start

The first time you start # systemctl start smb 

After modifying the configuration file to restart the service # systemctl restart smb

3.5 , adding users

useradd USERNAME

smbpasswd -a USERNAME

4.1 , Windows access

Ctrl + R open the Run window, enter two backslashes plus samba server address. Enter your user name and password

4.2 , mount ( Linux between systems)

# mount -t cifs -o username=USERNAME,password=PASSWORD //ServerIP/ShareDIR /LocalDIR

5 , test

Second, multiple users share files

1 , configuration-related configuration files

# yum /etc/samba/smb.conf

Configuration file contents:

[nidaye]                # to access the user to see the directory name

              comment = abcdef # shared directory description, you are free to fill in

              path = / nimei # shared directory (Native actual directory name) path, we need an absolute path

              write list = abcd # user writable list, a plurality of users separated by spaces

              read only = yes / no # whether the read-only

              writeable = yes / no # is writable

             valid users = ABCD # accessible by the user, a plurality of users separated by spaces

              = yes browseable / NO # (browse, read) whether significant

              directory mask = 0775 # create a default directory permissions

              create mask = 0664 # create a default file permissions

              guest ok = yes / no # if (not) the need for secondary verification ( Yes is unnecessary)

              public = yes / no # if (not) the need for secondary verification ( Yes is unnecessary)

2 , smbclient can view USERNAME directories or files shared

smbclient -U USERNAME -L server IP address

Development: two kinds of firewall off mode

1 , closed firewalld firewall

systemctl status firewalld view status

systemctl stop firewalld temporarily closed

systemctl disable firewalld permanently closed

2 , turn off selinux firewall

getenforce query the status of the firewall:

enforcing (mandatory kills) permissive (warning) Disabled (turn off the firewall)

setenforce 0 temporarily closed

Profiles:

/etc/selinux/config

SELINUX = disabled # permanently closed

reboot reboot the system to take effect

Guess you like

Origin www.cnblogs.com/renyz/p/11232089.html