Linux to build Samba shared server

Source: Internet
Author: User

Experimental requirements:

Samba File Share service configuration and access, configure access to users, and appropriate permissions.

Tips: Create Shared directories/test and/share, and create files under/test TF1 (read-only) TF2 (read-write) under/share create file PF1 (read-only) and PF2 (read-write)

1. Mount Local Yum Source

[[email protected]/]# mkdir/media/cdrom[[email protected]/]# mount/dev/cdrom  /media/cdrom/[[email protected]/]# Vim/etc/yum.repos.d/rhel-source.repo rhel-source]name=red Hat Enterprise Linux $releasever-$basearch-sourcebaseurl= File:///media/cdromenabled=1

2. Close SELinux and IPtables

[[email protected]/]# vim/etc/selinux/config    //path [[email protected]/]# Setenforce 0    //temporary close Selinux[[email Protected]/]#/etc/init.d/iptables  stop     //Shut down firewall

3. Installing Samba Services

[email protected]/]# Yum install samba-y

4. Create a shared user

[[email protected]/]# smbpasswd-a smb[[email protected]/]# smbpasswd-a SMB

5. Modify the configuration file

[[email protected]/]# vim/etc/samba/smb.conf         workgroup = Workgroup    //win needs to be modified to workgroup        Server string = Samba Server Version%v        security = user           //can be changed to everyone        passdb backend = tdbsam[test]        path =/test public        =  Yes        writeable = yes        valid users = smb[share]        path =/share public        = yes        writeable = yes        valid Users = SMB

6. Create local shared directories and file permissions

[[email protected]/]# mkdir/test/share[[email protected]/]# chown-r smb.smb/test//share/[[email protected] test]# t Ouch TP1 Tp2[[email protected] test]# chmod 444 TP1 [[email protected] test]# chmod 666 tp2[[email protected] test]# Echo "111" >/TEST/TP1    //ceshi text [[email protected] test]# echo "222" >/TEST/TP2

[[Email protected] test]# service SMB Restart//Open Services Test

  

Linux to build Samba shared server

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.