Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to configure Samba server under Debian

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "how to configure Samba server under Debian". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn how to configure Samba server under Debian.

1 introduction

If an organization has to use the M $Windows platform for their desktop computers, they will inevitably need Windows server products, such as Windows NT Server or Windows 2000 Server, or even Windows 2000 Advanced Server. You know, the software that legally owns these servers (the number of connections purchased under Microsoft's so-called license agreement), coupled with the high cost of hardware, is not a small cost. If there is a way for you to implement the function of Windows NT/2000 server for free on the basis of ordinary hardware, you say, why not?

This is the samba, a free, powerful, flexible, lightweight, samba.

2 background introduction

I have a machine with win2000 installed, called notepad, which belongs to the working group of workgroup.

My Debian GNU/Linux is installed on an ordinary desktop computer, the machine name is debian, the domain name is test.com.

3 installation

3.1 Software version

Because we use sid's sources.list, we get the 2.ArrayArray version + 3.0Alpha version of samba. Its configuration method is somewhat different from previous versions.

3.2 installation

The installation process is very simple:

Apt-get install samba

The system will ask you, please refer to these answers:

Configure samba with debconf? Yes .

Enter the workgroup name, or domain name: workgroup.

Encrypt with password? Yes .

How do I run samba? We chose the default daemons mode and let him listen in the background.

Create a samba password library? Yes .

4 Quick Test

You may not believe it, but now you can see this Linux host named Debian in Windows's online neighbors!

Find the workgroup group of your online neighbor and you will find that she is already there. What do you say? cheer up!

However, you will find that no matter what user name and password you enter, you will not be able to pass authentication. That's because we haven't told samba which users and passwords to verify.

5 Quick start

Samba has only one configuration file!

That's / etc/samba/smb.conf.

The following smb.conf with only a few lines can make samba 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, so what services is it providing? If you open / etc/samba/smb.conf, you may find it too much to read; well, we have a command to use: testparm. This command allows us to check whether the smb.conf is configured correctly, and to list the contents of an actually valid smb.conf:

# testparm

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

6.2Writing a minimum smb.conf

In fact, in order 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.

OK, we might as well use the above file, please change the name of / etc/samba/smb.conf to smb.conf.backup, for example, and then copy the above and save it as the new / etc/samba/smb.conf.

Remember, if the modified smb.conf takes effect, you need to restart samba:

# / etc/init.d/samba restart

6.3 create a user

Before we created the user, no one could access the samba server, that is, on the windows platform, no matter what username and password you used, you could not access the debian machine in the network neighbor.

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

# touch / etc/samba/smbpasswd

Then, using the smbpasswd command, add the samba user:

# smbpasswd-a kanaka

New SMB password:

Retype new SMB password:

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

7 Test

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

Thank you for your reading, the above is the content of "how to configure Samba server under Debian". After the study of this article, I believe you have a deeper understanding of how to configure Samba server under Debian, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report