Samba Quick Configuration

Source: Internet
Author: User

Samba is a software component that interacts with linux,unix,windows, and Sanma is a free open source software based on the GPL protocol.

Quickly configure Samba file servers

1. Turn off the firewall and SELinux

[email protected] ~]# Setenforce 0 #临时关闭

[[Email protected] ~] # sed-i "/selinux=/c selinux=disable" \

>/etc/sysconfig/selinux #永久的关闭

[[Email protected] ~] # service iptables stop #临时关闭

[Email protected]~]# servlce iptables off #永久关闭防火墙


2. Installing the Samba software

[[email protected] ~]# yum-y Install Samba


3. Create a shared directory

[[email protected] ~]# Mkdir/common---Create a directory

[[Email protected]~]# chmod 777/common---set permissions

[Email protected]~]# echo "Hello the Sky Bolg" >/common/smb.txt---Create a test file


4. Modify the configuration file

Configuration file by default in:/etc/samba/smb.conf

[Email protected] ~]# vim /etc/samba/smb.conf

Commet =common Share #共享注释

Path =/common #共享路径

Browseable =yes #所有人可见

Guest OK =no #拒绝匿名访问

Writable =yes #支持数据写入


5. Create an Access account

[[Email protected] ~] # useradd-i/sibin/nologin smbuser

[Email protected] 6~]# smbpasswd-a Smbuser

New SMB Password: #输入密码

Retype new SMB Password: #在输入一次密码

Tip This message indicates a successful addition: added User Smbuser.


6. Use of the SMBPASSWD command:

-A Add user

-X Delete User

-D Disabling users

-E Enable Account



7. Start the service

[[Email protected] ~] Service SMB start

[[email protected] ~]chkconfig SMB on


Test: Access the shared folder under win (assuming IP is: 192.168.2.3)

Start-and-run input (\\192.168.2.3) Enter the user name and password after logging in, you can see two directories common and Smbuser directory.


At this point, the Samba Quick configuration tutorial concludes.

Samba Quick Configuration

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.