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 build Samba sharing Server in Linux system

2025-04-08 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "how to build Samba shared server in Linux system". In daily operation, I believe many people have doubts about how to build Samba shared server in Linux system. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts about "how to build Samba shared server in Linux system". Next, please follow the editor to study!

1. First of all, you need to log in to the computer where the Linux system is installed and install Samba. Fedora distributions generally use the yum tool to install the Samba server, you can use "rpm-Q samba" to query whether the Samba server is installed, of course, you can also use "yum install samba" to install the Samba server directly. If Samba is already installed, yum will give you a prompt, otherwise follow the steps and type "y" to download and install the Samba server directly.

2. After the installation is completed, you need to check whether Samba has been added to the self-starting service. Use the "/ sbin/chkconfig | grep smb" and "/ sbin/chkconfig | grep nmb" commands to see if smb and nmb are added to the system service. SMB is a Samba sharing service, and nmb is a NetBIOS service. In order to cooperate with Windows, both of their services are added to the system service. Then use "/ sbin/service smb status" and "/ sbin/service nmb status" to see if the service is enabled.

3. The next step is to configure the samba server. Edit and modify "/ etc/samba/smb.conf" to set sharing and authentication parameters. As shown in the figure, I am using Samba users to share typical configuration files. After editing and modifying, you can use "testparm / etc/samba/smb.conf" to verify the validity of the configuration file so that the Samba service cannot be started due to a configuration file error.

4. To verify OK, the next step is to add Samba sharing users, use "/ usr/bin/smbpasswd-a" to add Samba sharing users, and set the password for each user to authenticate Samba shares.

5. Basically, the Samba server configuration is completed here. If smb and nmb services are not automatically added to the system services in the above steps, you can use "/ sbin/chkconfig-- level 2345 smb on" and "/ sbin/chkconfig-- level 2345 nmb on" to add them to the system services, where 2345 is the running level of Linux, which generally does not exceed these running levels. Then we can restart the service using "/ sbin/service smb restart" and "/ sbin/service nmb restart".

6. After the restart is completed, Windows can access the user share. Enter "\\ shared IP address\ shared user" in Windows Explorer to access all files in the user's own directory.

7. To test the sharing permissions, we went to the user's shared directory and tried to create a "test" directory in Windows Explorer.

8. When we go back to the user directory of Linux, we can see that the user shared directory looked up by Windows and Linux is the same. You may think that the files you see are inconsistent with the directories, because my Windows is set to show hidden files and folders. )

Note: there is no separate shared directory for Linux, that is another topic. Users who share must already exist in Linux, otherwise Samba does not allow users to be added to the share.

At this point, the study on "how to build a Samba shared server in Linux system" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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