Configure the Samba server On Debian

Source: Internet
Author: User
Configure the Samba server-Linux Enterprise Application-Linux server application information On Debian. For more information, see. 1 Introduction

If a certain unit and their desktop computer must use the M $ Windows platform, they may inevitably need Windows Server products, such as Windows NT Server or Windows 2000 Server, or even Windows 2000 Advanced Server. You know, if you want to legally own the software on these servers (purchase connections according to Microsoft's so-called license agreement), and add expensive hardware costs, it is not a relatively small cost. If there is a way for you to implement the functions of Windows NT/2000 servers for free on the basis of common hardware, what do you mean?
-- This is samba, a free, powerful, flexible, and lightweight samba.

2. Background

If you are not reading my article from chapter 1, I have to introduce these situations:
One of my machines with win2000 installed is notepad, which belongs to the workgroup Working Group.
My Debian GNU/Linux is installed on a common desktop computer. The machine name is debian and the domain name is test.com.

3 installation

3.1 software version

We use the sources. list of sid, so we get samba of version 2.99 + 3.0Alpha. The configuration method is somewhat different from the previous version.

3.2 Installation

The installation process is very simple:

Apt-get install samba


The system will ask you, please refer to these answers:
Use debconf to configure samba? Yes.
Enter the workgroup name or domain name: workgroup.
Password encryption? Yes.
How to run samba? We select the default daemons Method for listening in the background.
Create a samba password library? Yes.

4 small tests

You may not believe it, but now you can see this Linux host named Debian in the Windows Network Neighbor!
Find the workgroup Group of the network neighbor and you will find that she is already there. How are you doing!
However, you will find that no matter what user name or password you enter, the verification fails. That's because we haven't told samba which users and passwords to verify.
  
5. Quick Start

Samba has only one configuration file!
That is/etc/samba/smb. conf.
The following is only a few lines of smb. conf, so samba can work for us!

[Global]
Log file =/var/log/samba/log. % m
[Tmp]
Comment = Temporary file space
Path =/tmp
Read only = no
Public = yes


6. Configuration

6.1 check the current configuration

Our samba is now running. What services does it provide? If you open/etc/samba/smb. conf, you may think that there is too much content. Well, we have a command to use testparm. With this command, we can check whether the configuration of smb. conf is correct and list a valid smb. conf file:

# Testparm


Through this command, you can see that the configuration that actually plays a role is just a few lines.

6.2 write a minimum smb. conf

In fact, to do the experiment, we can write a smaller smb. conf, as mentioned in the previous section. That configuration file allows samba to share/tmp and write files to it.
Well, we may as well use the above file. Please put/etc/samba/smb first. change the conf name, for example, to smb. conf. backup, and then copy the above content and save it as the new/etc/samba/smb. conf.
Remember, if the modified smb. conf takes effect, restart samba:

#/Etc/init. d/samba restart


6.3 create a user

No one can access the samba server before we create a user. That is to say, on windows, no matter what user name or password we use, we cannot access the debian machine in the network neighbor.

We need to generate a file under the/etc/samba/directory named smbpasswd:

# Touch/etc/samba/smbpasswd


Then, run the smbpasswd command to add the samba User:

# Smbpasswd-a kanaka
New SMB password:
Retype new SMB password:


At this time, kanaka is written into the/etc/samba/smbpasswd file, and kanaka can access samba from windows.

7. Test

In your windows system, find the debian of the network neighbor, access it with the user you just created, and copy a file to the tmp directory. Okay.

8 TODO

This is the 0.1 version of this article, purely for beginners.
In the next version, I will describe in detail how to configure smb. conf to implement the functions of the WinNT/2000 Server.
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.