"Linuxservice" SMB and CIFS

Source: Internet
Author: User

# 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.