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 install Fedora Samba system server build

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

Share

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

This article mainly introduces how to install Fedora Samba system server construction, the article is very detailed, has a certain reference value, interested friends must read it!

Construction of Fedora 9 Samba Server

As one of the Windows network functions, these requirements can usually be achieved between Windows clients through the inherent capabilities of Windows Network. However, through Fedora Samba, we can also make a Fedora host compatible with the Windows network, achieve the same function, and then make full use of the availability of the Fedora host.

This paper mainly introduces how to realize file sharing in Windows network through the construction of Fedora Samba server.

SMB protocol is an application protocol based on NetBIOS protocol, which is based on TCP138 and 139. after the emergence of NetBIOS, Microsoft uses NetBIOS to implement a network file / print service system. This system sets a set of file sharing protocol based on NetBIOS, which Microsoft calls SMB (Server Message Block) protocol. This protocol is used in Lan Manager and Windows server systems to realize the sharing of printers and files between different computers. Therefore, in order to integrate Windows and Unix/Linux computers, the solution is to install software that supports the SMB protocol on Unix/Linux computers. In this way, clients that use Windows do not need to change the settings and can use shared resources on Unix/Linux computers just like Windows NT or Windows 2000 servers.

Fedora Samba makes the SMB protocol run over the NetBIOS protocol, and uses Windows's NetBEUI protocol to make the Unix/Linux server accessible on Windows's network neighbors.

Install Fedora Samba

First, install Fedora Samba online through yum.

Yum-y install samba

Configure Fedora Samba

Then, configure Fedora Samba according to your requirements by editing / etc/samba/smb.conf. Here, the principle of this article is to apply file sharing only to the intranet, and let the directory to be shared have sufficient read and write permissions.

[root@sample ~] # vi / etc/samba/smb.conf ← edits the configuration file of Fedora Samba

Workgroup = WORKGROUP / / set up the workgroup

Server string =% users samba% v / / description% U represents the currently logged in user

Netbios name = fedora / / netbios name, fedora9 is not enabled by default

Log file = / var/log/samba/log.%m / / Log file save path% m your windows hostname

Max log size = 50 / / log * * capacity

Security = user / / Security level, user requires username and password, share level does not

[samba] / / create a share named samba

Comment = samba / / description information

Path = / home/suyang/samba / / share path

Public = no / / whether guest users are allowed to access (equivalent to guest ok = yes/no)

Writable = yes / / whether it is writable

Write list = suyang / / list of users that can be written (@ represents user group)

Next, create a private directory that will be shared to the Windows network through Fedora Samba.

[root@sample ~] # mkdir / home/suyang/samba ← to establish a special directory for shared files

[root@sample] # chown-R nobody. / home/suyang/samba ← sets the private directory to be nobody

[root@sample ~] # chmod 777 / home/suyang/samba ← sets the private directory property to 777

Before making a connection to the server, the user used to log in to the Fedora Samba needs to be set up in advance. Here we take the Fedora Samba standard Samba user database management tool "smbpasswd" as an example to create user data for logging in to Fedora Samba. One thing to note here: the premise for creating a user with smbpasswd is that the user exists in the system user-- based on the system user, before the user's information in the Fedora Samba user database can be created.

[root@sample] # smbpasswd-a suyang ← adds the system user suyang (for example) to the Fedora Samba user database

New SMB password: ← enter the password that the user uses to log in to Fedora Samba

Retype new SMB password: ← reconfirms entering the password

Start the Fedora Samba service

Before starting the Fedora Samba service, first open the port used by Fedora Samba in the firewall settings.

[root@sample ~] # vi / etc/sysconfig/iptables ← Editing iptables configuration File

-A RH-Firewall-1-INPUT-m state-- state NEW-m tcp-p tcp-- dport 25-j ACCEPT ← find this line and add the following line below:

-A RH-Firewall-1-INPUT-m state-- state NEW-m tcp-p tcp-- dport 139-j ACCEPT

-A RH-Firewall-1-INPUT-m state-- state NEW-m tcp-p tcp-- dport 445-j ACCEPT

-A RH-Firewall-1-INPUT-p udp-m udp-- dport 137-j ACCEPT

-A RH-Firewall-1-INPUT-p udp-m udp-- dport 138j ACCEPT

[root@sample ~] # / etc/rc.d/init.d/iptables restart ← restart iptables to make the new rules effective

Flushing firewall rules: [OK]

Setting chains to policy ACCEPT: filter [OK]

Unloading iptables modules: [OK]

Applying iptables firewall rules: [OK]

* to start the Fedora Samba service (including two daemons: smb,nmb).

[root@sample ~] # chkconfig smb on ← sets Fedora Samba self-startup

[root@sample ~] # chkconfig-- list smb ← confirms the Fedora Samba startup tag and confirms that 2-5 is the status of on

Smb 0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@sample ~] # chkconfig nmb on ← sets nmb self-startup

[root@sample ~] # chkconfig-- list nmb ← confirms the nmb startup tag and confirms that 2-5 is the status of on

Nmb 0:off 1:off 2:on 3:on 4:on 5:on 6:off

[root@sample ~] # / etc/rc.d/init.d/smb start ← starts the Fedora Samba service

Starting SMB services: [OK]

[root@sample ~] # / etc/rc.d/init.d/nmb start ← starts the nmb service

Starting NMB services: [OK]

[note:]

1. Smbd listens to 139 TCP ports to set up shared directories, printing, etc.

2. Nmbd 137. 138UDP port management group, NetBIOS and other resolution work

What we should note here is that fedora9 separates the smb and nmb services for security reasons. Usually, when we use the Fedora samba service, when we start the smb service, the nmb service will also be started, but not in fedora9. As a result, when we set up the share in fedora9, we can only use [url= file://ip/]""ip[/url] to access it. Instead of using [url=file:// computer name /] "" computer name [/ url], the solution is to start both smb and nmb services at the same time.

The above is all the contents of the article "how to install Fedora Samba system server build". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

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