Build samba server under CentOS6.4

Source: Internet
Author: User
Tags centos server putty ssh client
Recently, the company developed software projects and shared documents of the entire team are stored in a unified manner to facilitate development. Therefore, we have built a samba file server. below we record the simple steps for future reference, shared with you. 1. basic information: Server: IBM Operating system: centos server software: samba client: win7, puttyssh client 2. install samba: yum-yinstallsamba3. create the shared directory mkdir/home/linuxchmod

Recently, the company developed software projects and shared documents of the entire team are stored in a unified manner to facilitate development. Therefore, we have built a samba file server. below we record the simple steps for future reference, shared with you.

1. Basic information:

Server: IBM

Operating system: centos

Server software: samba

Client: win 7, putty ssh client

2. install samba:


Yum-y install samba

3. create a shared directory


Mkdir/home/linuxchmod-R 777/home/linux

4. Grant the shared file directory access permission


Chcon-R-t samba_share_t/home/linux

Modify the security attribute of the shared directory. because centos samba cannot access any folder by default, you must change the security attribute of the folder to obtain the access permission. Otherwise, you cannot access the shared directory (key)

5. add the samba user name and password


Useradd sgd // add the user name passwd sgd to the system // add the password smbpasswd-a sgd to the user name // add the user to the samba Server

6. modify the configuration file smb. conf.


[Global] workgroup = WORKGROUP // modified the working group and the name of the file server in the same working group server string = program linux % v //

The user configuration can be written like this, but it can be used anyway:


[Program-linux] comment = program linuxpath =/home/program // This user can access public = nobrowseable = yes // can read, view writable = yes // can write valid users = sgd // username create mode = 1777 // create file permission force create mode = 1777 directry mode = 1777 // create folder permission force directry mode = 1777

If you want to grant different permissions to users, you can modify the preceding configurations, such as writing, reading, and copying.

7. modify the firewall configuration:


/Sbin/iptables-I input-p tcp -- dport 139-j ACCEPT/sbin/iptables-I INPUT-p tcp -- dport 445-j ACCEPT/Save the firewall configuration/etc/rc. d/init. d/iptables save // restart/etc/rc. d/init. d/iptables restart or start/etc/rc. d/init. d/iptables start

8. add boot start:


Chkconfig smb on

9. start the samba service:


/Etc/rc. d/init. d/smb start // or restart/etc/rc. d/init. d/smb restart

10. access in win 7:


\ 192.168.3.234

Enter the user name and password.


Related Article

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.