# porpose:shareing file system between Windows and Linux using network
Protocol
SMB (Service Message Block): shareing Linux file system to Windows
CIFS (Common Internet file system): Shareing Windows file system to Linux
Software for Smb:samba
Samba is using 137/UDP, 138/UDP, 139/tcp, 445/tcp
Netbios:windows based on the host to achieve mutual communication mechanism;
15 characters
Samba:
Nmbd:netbios
Smbd:cifs
WINBINDD:
UNC path: \\SERVER\shared_name
Interactive Data access:
# smbclient-l Host-u USERNAME
After you have obtained the shared information,
# Smbclint//server/shared_name-u USERNAME
Mount-based access:
Mount-t CIFS//server/shared_name/mount_point-o Username=username,password=password
Server:
# yum-y Install Samba
Service script:
/etc/rc.d/init.d/nmb
/etc/rc.d/init.d/smb
Master configuration file:
/etc/samba/smb.conf
Samba Users:
Account: All system users,/etc/passwd
Password: Samba service own password file,
To add a system user as a Samba command: SMBPASSWD
smbpasswd
-A sys_user: Adding system users to Samba users
-D: Disable
-E: Enabled
-X: Delete
Configuration file:
Smb.conf
Global Settings
Settings for specific shares
Private home Directory
Printer Sharing
Custom Share
Custom share:
[Shared_name]
Path =/path/to/share_directory
Comment = Comment String
Guest OK = {Yes|no}
public = {Yes|no}
writable = {Yes|no}
Read Only = {Yes|no}
Write list = +group_name
Test the configuration file for syntax errors, and show the configuration that is finally in effect:
# Testparm
Set up Samba share, share directory as/data, ask:
1) share named GKFX, workgroup for magedu;
2) Add group develop, add user Gentoo,centos and Ubuntu, where Gentoo and CentOS develop as additional group, Ubuntu does not belong to develop group; passwords are user names;
3) Add Samba users Gentoo,centos and Ubuntu, passwords are "mageedu";
4) This Samba share shared only allows the develop group to have write permission, and other users can only access it in read-only mode;
5) This Samba sharing service only allows host access from the 172.16.0.0/16 network;
"Linuxservice" SMB and CIFS