"Reproduced" Linux in detailed installation of samba (for Windows and Linux file sharing)

Source: Internet
Author: User

To enable the sharing of resources between Windows hosts and Linux servers, the Linux operating system provides samba services, and the Samba service bridges two different operating systems, enabling communication between Linux systems and Windows systems. Provides great convenience for a wide range of Linux enthusiasts. This article briefly describes how to build a Samba server and simple configuration on a Linux operating system.

1. Service Enquiry

By default, the Linux system already has part of the Samba service pack installed in the default installation, and in order to have a complete understanding of the process, uninstall this section first. Using commands

Rpm-qa | grep samba, by default, can query to two existing packages:

Samba-client-3.0.33-3.7.el5

Samba-common-3.0.33-3.7.el5

2. Uninstalling Samba

Use RPM-E to unload two packages. For Samba-common-3.0.33-3.7.el5, because there is a dependency between the other RPM packages, the parameter-F and--nodeps,-f are mandatory,--nodeps means not checking the dependencies, the complete command is:

rpm-e samba-common-3.0.33-3.7.el5-f--nodeps

RPM-E samba-client-3.0.33-3.7.el5-f--nodeps

3. Install Samba

Install with the following command:

RPM-IVH samba-3.0.33-3.29.el5_6.2.i386.rpm-f--nodeps

RPM-IVH samba-client-3.0.33-3.29.el5_6.2.i386.rpm-f--nodepsRPM-IVH samba-common-3.0.33-3.29.el5_6.2.i386.rpm-f--nodeps

After the installation is complete, use the command Rpm-qa | grep Samba queries and finds that all the servers on which the Samba server is built are already installed.

4. Configuring the Smb.conf File

Samba profiles are typically placed in the/etc/samba directory, The main configuration file named Smb.conf, which records a large number of rules and shared information, is a core configuration file that is very important to samba services, and most of the major configurations that complete the Samba server Setup are in this file.

The Samba server works by initiating a request to the Samba server, requesting access to the shared directory, and the Samba server receiving the request, Query the smb.conf file, see if the shared directory exists, and the access rights of the visitor, if the visitor has the appropriate permissions, allow the client access, and finally the system information during the access process and the user Access behavior information collected in the log file.

First Step: Modify the configuration file

First, backup the Samba configuration file

Cd/etc/samba

MV Smb.conf Smb.confbak

Then re-create a smb.conf file

Touch smb.conf

And then we write this into the smb.conf.

[Global]

workgroup = Linuxsir

NetBIOS name = LinuxSir05
Server string = Linux Samba Server testserver
Security = Share

[Linuxsir]
Path =/opt/linuxsir
writeable = yes
browseable = yes

Guest OK = yes

notes:

[Global] This is the global configuration, is required to write the paragraph. which have the following lines;

Workgroup is the workgroup that is displayed in Windows, where I set the Linuxsir (in uppercase);
NetBIOS name is the name of the computer displayed in Windows;
Server string is the Samba server description that can be defined by itself; this is not important;
Security This is the authentication and login method, here we use share; there are many kinds of authentication methods, this is one of them; another commonly used is the user authentication method, if using share, it is not necessary to set the user and password;

[Linuxsir] This is displayed in Windows is a shared directory;
Path = You can set where the directory you want to share is placed;
Whether writeable can be written, here I set as writable;
Whether browseable can be browsed, can be browsed means that we can see the shared folder under the workgroup. If you don't want to show it, set it to Browseable=no

Guest OK anonymous user is logged in as guest;

The second step: the establishment of the corresponding directory and authorization;

[Email protected] ~]# mkdir-p/opt/linuxsir

[[email protected] ~]# ID Nobody
uid=99 (nobody) gid=99 (nobody) groups=99 (nobody)

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

Comments:

Regarding the authorization nobody, we first use the ID command to view the nobody user's information, discovers his user group also nobody, we must take this as the prevail. Some systems nobody user groups are not nobody;

Step three: Start SMBD and NMBD server;

[Email protected] ~]# SMBD

[Email protected] ~]# NMBD

[[email protected] ~]# service SMB Restart--Restart SMB service

"Reproduced" Linux in detailed installation of samba (for Windows and Linux file sharing)

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.