Samba builds Linux resources for sharing in Windows

Source: Internet
Author: User

  1. Yum Install-y Samba Samba-client

  2. Configure configuration files for SMB

    Vim/etc/samba/smb.conf

    Modify Workgroup=workgroup

  3. Example 1 (share a directory, anyone can access it without entering a password, but requires read-only)

    Change the security=user into a security=share.

    [Test] (Shared directory: Note that this shared directory does not exist in Linux)

    Comment=shar All (here is the description, whatever you write)

    Path=/tmp/samba (This is the real access to the directory, it is best to set permissions 777)

    Browseable=yes

    Public=yes

    Writable=no (Read only)

  4. mkdir/tmp/samba/

  5. Touch/tmp/samba/1.txt

  6. Start/ETC/INIT.D/SMB Start

  7. Browser input Fiel://ip/test

  8. Example 2 (share a directory, need to use the account password to access, requirements can read and write)

    Security=user

    Here because Passdb Backend=tdbsam, so in the creation of virtual account and system account (two accounts, the system account must exist, in order to create a virtual account) to use the Pdbedit

  9. [Test2]

    Comment=share for users

    Path=/tmp/samba

    Browseable=yes

    Writable=yes

    Public=no

  10. Mkdir/tmp/samba

  11. chmod 777/tmp/samba

  12. Create a System account

    Useradd user1

    Pdbedit-a user1

    Note: pdbedit-l list accounts

    Pdbedit-x Account Delete Account

  13. Service SMB Start

  14. File://ip/test2

    Enter your account password

  15. If you are a Linux user:

    Smbclient//ip/test2/-U user1

  16. The shared implementation can be mounted

    Mount-t cifs/ip/test2/mnt/-O username=user1,password=123456

  17. Df-h View


This post is self-taught experience, Master do not spray!

This article from the "Linux Learning Space" blog, reproduced please contact the author!

Samba builds Linux resources for sharing in Windows

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.