Linux LAN file sharing system Samba

Source: Internet
Author: User
Tags deprecated ftp file to domain

School in the school room to see the FTP file sharing system, the server is Windows, the feeling is really powerful, no matter which machine can share a folder, and later in the home by looking at various materials, with their own Win7 do FTP server, do a file server, But really very chicken, the operation experience is really unsatisfactory.


The following is a Linux server platform installed file sharing system software Samba, the file sharing system deployed through Samba can be compatible with the three main operating systems of Mac, Linux and Windows, and the operating experience is very good, I made a small sharing system at home, Home Server configuration: CPU: Atom d2500,2g Memory, 32G SSD a small server, 4m bandwidth, speed seconds to kill ftp, file upload and download are around 11m/s.


Below is a brief introduction of CentOS under the installation process of Yum, if it is used within the company, will generally compile and install samba, and then do some details of the authorization verification, I do the home, can be used, if you want to do more details of the allocation of authority, to degree Niang, reference several mol.


Installation:

[email protected] ~]# Yum install samba samba-client Samba-swat


Set up SMB and NMB at the 3, 5 boot level with system boot:

[Email protected] ~]# chkconfig--level SMB on

[Email protected] ~]# chkconfig--level NMB on


To configure Samba:

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


Make the following changes:

#======================= Global Settings =====================================[global]config file =/usr/local/samba /lib/smb.conf.%m#-----------------------Network related Options-------------------------# workgroup = Nt-domain-name or Workgroup-name, eg:midearth## server string is the equivalent of the NT Description field## NetBIOS Nam E can be used to specify a server name is tied to the hostname## Interfaces lets we configure Samba to use multiple inte  rfaces# If You have multiple network interfaces so you can list the ones# you want to listen on (never omit localhost) # #        Hosts allow/hosts Deny lets restrict who can connect, and you can# specifiy it as a per share option as well#       Workgroup = MyGroup Server string = Samba server Version%v; NetBIOS name = MYSERVER interfaces = Lo eth0 192.168.1.11/24 192.168.1.1/255 hosts allow = 127. 192.168.1.192.168.0.#---------------------------Logging Options-----------------------------# # Log FilE let's specify where to put logs and what to split them up.## max Log size let you specify the max size log files should         Reach # Logs split per machine log file =/var/log/samba/log.%m # max 50KB per log file and then rotate  Max log size = 50#-----------------------Standalone Server Options------------------------# scurity can be set To user, share (deprecated) or server (deprecated) # # backend to store user information in. New installations should # Use either Tdbsam or Ldapsam. SMBPASSWD is available for backwards # compatibility.        Tdbsam requires no further configuration. Security=share #security = user #passdb backend = tdbsam#-----------------------Domain Members Options--- ---------------------# # Security must be set to domain or ads## use the realm option only with Security = ads# Specifies t He Active Directory Realm the host is part of## backend to store user information in. New installations should # Use either Tdbsam or LDAPSAM. smbpasswd is available for backwards # compatibility. Tdbsam requires no further configuration.## use password server option, with security = Server or if you can ' t# use th E DNS to locate Domain controllers# the argument list may include:# password server = my_pdc_name [My_bdc_name] [My_next       _bdc_name]# or to auto-locate the domain controller/s# password server = *;       Security = domain;       Passdb backend = Tdbsam;       realm = My_realm; Password Server = <nt-server-name>#-----------------------Domain Controller Options------------------------# # Security must is set to the user for domain controllers# use either Tdbsam or Ldapsam. SMBPASSWD is available for backwards # compatibility. Tdbsam requires no further configuration.## domain master specifies Samba to be the domain Master Browser. this# allows Samba to collate browse lists between subnets. Don ' t use this# if you already has a Windows NT domain controller doing this job## domain logons let Samba be a Domain logon server for Windows workstations. # # Logon Scrpit Let Yuou specify a script to being run at login time on the client# you need to provide it in a share called netlogon## Logon path Let specify where user profiles is stored (UNC Path) # # Various scripts can be used on a domain       Controller or stand-alone# machine to add or delete corresponding Unix accounts#;       Security = user;       Passdb backend = Tdbsam;       Domain master = yes;       Domain logons = yes # The login script name depends on the machine name;       logon script =%m.bat # The login script name depends on the UNIX user used;       logon script =%u.bat;       Logon path = \\%l\profiles\%u # disables Profiles support by specifing an empty path;       Logon path =;       Add User script =/usr/sbin/useradd "%u"-n-g users;       Add Group script =/usr/sbin/groupadd "%g";       Delete user script =/usr/sbin/userdel "%u"; Delete user from group script =/usr/sbin/usErdel "%u" "%g"; Delete Group script =/usr/sbin/groupdel "%g" #-----------------------Browser Control Options------------------------- ---# # set local master to No if you don ' t want Samba to become a master# browser on your network. Otherwise the normal election rules apply## OS level determines the precedence of this server in master browser# elections . The default value should is reasonable## Preferred Master causes Samba to force a local browser election on startup# and G       Ives it a slightly higher chance of winning the election;       Local master = no;       OS level = 33; Preferred master = yes#-----------------------------Name Resolution-------------------------------# Windows Internet Name serving support section:# Note:samba can is either a WINS Server, or a WINS Client, but not both##-WINS support:t Ells the NMBD component of Samba to enable it's wins server##-Wins server:tells the NMBD components of Samba to bes a WI NS client##-WINS proxy:tells Samba to Answer name resolution queries on# behalf of a non WINS capable client, for the to work there must be# at least one WINS Server on the network.       The default is no.## DNS Proxy-tells Samba Whether or not to try to resolve NetBIOS names# via DNS nslookups.;       WINS support = yes;       WINS Server = w.x.y.z;       WINS proxy = yes; DNS proxy = yes#---------------------------Printing Options-----------------------------# # Load Printers let you load a utomatically the list of printers rather# than setting them up individually## cups Options let pass the cups Libs Cust Om options, setting it to raw# for example'll let's use drivers on your Windows clients## Printcap Name Let's specif Y an alternative printcap file## you can choose a non default printing system using the printing option load Printe       rs = yes cups options = raw;       Printcap name =/etc/printcap #obtain List of printers automatically on SYSTEMV; Printcap name = LpstaT printing = cups#---------------------------Filesystem Options---------------------------# # The following options can B E uncommented If the filesystem supports# Extended Attributes and they is enabled (usually by the Mount option# User_xatt R). thess options would let the admin store the DOS attributes# in a EA and make samba don't mess with the permission bits.#       # Note:these options can also bes set just per share, setting them in global# makes them the default for all shares;       Map archive = no;       Map hidden = no;       Map Read Only = no;       Map system = no; Store DOS attributes = yes#============================ Share definitions ==============================[homes] com       ment = Home Directories browseable = no writable = yes;       Valid users =%s;        Valid users = mydomain\%s[printers] Comment = all printers Path =/var/spool/samba browseable = no Guest OK = no writable = no printable = yes# Un-comment the following and create the Netlogon directory for Domain logons;       [Netlogon];       Comment = Network Logon Service;       Path =/var/lib/samba/netlogon;       Guest OK = yes;       writable = no; Share modes = no# Un-comment The following to provide a specific roving profile share# the default was to use the user ' s Ho       Me directory;       [Profiles];       Path =/var/lib/samba/profiles;       browseable = no;        Guest OK = yes# A publicly accessible directory, but read only, except for people in# the ' staff ' Group [public] Comment = Public Stuff path =/share Public = yes writable = yes printable = no WR ITE list = +staff

Create a shared folder and assign nobody permissions:

[Email protected] ~]# Mkdir/share


[Email protected] ~]# chown-r Nobody:nobody/share


To turn off the firewall:

[Email protected] ~]# chkconfig iptables off


To turn off SELinux:

[Email protected] ~]# Vim/etc/sysconfig/selinux

Modified to:

#SELINUX =enforcingselinux=disabled

Restart:

[[Email protected] ~]# Init 6


Once the reboot is complete, you can connect to the shared directory via a computer in the LAN, such as Windows:

Connection Sharing directory: Win key +r, and then type \\IP address \, such as: \\192.168.1.18\, results such as:


This allows you to manipulate the shared directory. If you want to not do this every time you can map it to a network address, it is easy to operate, and the local disk as convenient, such as:



Well, the configuration of samba is here, and hopefully it will help you.








Linux LAN file sharing system Samba

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.