Deploy and tune 1.8 Samba deployment and optimization-2

Source: Internet
Author: User

It is very useful for us to realize that Samba can share files with Linux and Windows machines. Here are a few practices to learn about Samba, note: Before you practice, check if Selinux is off or it might not be successful.

Practice 1

Requirements: Share a directory, anyone can access, that is, without entering a password to access, require read-only

Open the Samba configuration file in the [Global] section

Vim/etc/samba/smb.conf

Change to Security = Share

Change to Workgroup = Workgroup

Then add the following at the very end of the file:

==/tmp/= Yes public == no

The shared name is Wangshaojun.

Comment Share All

Location of path shared directory

Browseble whether the workgroup is allowed to see

Public is open

Whether writable can be written

Start Samba

/ETC/INIT.D/SMB start

To create a shared directory

Mkdir/tmp/sambadir

Write something in there.

cp/etc/passwd/tmp/sambadir/1. txt

Create a directory, authorize 777. Normal can be created, because the configuration is forbidden to write, verify whether writable

Mkdir/tmp/sambadir/test
777 !$

Test, how to access the share

Under Windows, click Start-run

Creation is not allowed.

Access under Linux

Input command

// 192.168.1.117/wangshaojun

Prompt to enter a password. Direct return

There is another way to mount it.

Installing Mount-related

Yum Install-y cifs-utils

Mount

// 192.168.1.117/wangshaojun/opt/

View

Df-h

192.168.1.117/wangshaojun 18G 3.6G 14G 21%/opt

has been mounted under opt

LS view file under opt directory

Ls/opt

Deploy and tune 1.8 Samba deployment and optimization-2

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.