This two-day business needs to take a server. Requirements samba share files.
Foreplay grape wine cup of moonlight on the province, we directly on dry goods.
1, yum attached samba
yum -y install samba
2, the /etc/samba/smb.conf file backup a (personal habits, not the backup is also possible)
cp /etc/samba/smb.conf /etc/samba/smb.conf.bak
3, modify the corresponding file
[root @ ceshi01-10 Samba] CAT smb.conf #
# See More A smb.conf.example for the Detailed config File or
# at The smb.conf the Read the manpage.
# the Run 'testparm' to correct the After the Verify at The config IS
# you Modified IT.
[, Ltd. Free Join]
Workgroup = SAMBA
Security = the User
passdb backend = tdbsam
Printing = the CUPS
printcap name = the CUPS
the Load Printers = yes
the CUPS Options = RAW
the Map = Bad to the Guest shall be added after the User # centos7 this line the
hosts allow = 192.168 .10.21 192.168.10.22 # ip only certain access to this samba server; can be separated by a space between a plurality ip; If one segment permitting, it can be: 192.168.10.0/24
[Homes]
Comment = the Directories Home
Valid Users =% S,% S% W% D
browseable, = No
Read only = No
the inherit ACLs and = Yes
[Printers]
Comment = All Printers
path = / var / tmp
Printable = Yes
Create mask = 0600
browseable, = No
[Print $]
Comment = Printer the Drivers
path = / var / lib / Samba / the Drivers
the Write List = @printadmin root
Force Group = @printadmin
the Create mask = 0664
Directory mask = 0775
[myshare] # this is a term samba share files; they can easily play a 123 will do, but it is best to get up a little on behalf of of
comment = yang share # behind this comment is the interpretation of the text of this samba
path = / data #path to share the path, remember that it must give the path to the appropriate authority, or access to be wrong.
writable = yes # decided to visit the user can write to the
guest ok = yes # guest user determine whether access
browseable = yes # For security reasons, and sometimes let the client can not see a shared directory, so only administrators or some important people know there is such a directory on the Samba server, while other people do not know this directory.
[root @ ceshi01-10 samba] #
4, to remember the server's firewall must be shut down; open or firewall permission for the job.
5, samba client server-side installation
yum install cifs-utils
mount -t cifs -o username = "root", password = "" // ip / shared folder name / mount point
Column such as:
mount -t cifs -o username="root",password="p" //192.168.10.20/myshare /mnt
[root@ceshi02-10 ~]# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/centos-root 17G 7.9G 9.2G 47% /
devtmpfs 898M 0 898M 0% /dev
tmpfs 910M 0 910M 0% /dev/shm
tmpfs 910M 9.6M 901M 2% /run
tmpfs 910M 0 910M 0% /sys/fs/cgroup
/dev/sda1 1014M 146M 869M 15% /boot
tmpfs 182M 0 182M 0% /run/user/0
//192.168.10.20/myshare 17G 1.4G 16G 8% /mnt
[root@ceshi02-10 ~]# vf mnt
6, if it is windows, then access
Direct windows + R popups input \\ 192.168.10.20 it.