Detailed description of FedoraSamba configuration and installation

Source: Internet
Author: User
After learning Samba for a long time, I will share with you that you may encounter a FedoraSamba problem. After reading this article, you will certainly have a lot of GAINS. Here we will introduce the solutions to the FedoraSamba problem, I hope this article will teach you more things. When we use Windows as the client, we usually need to share files and print files. As one of Windows network functions, you can use the Inherent functions of Windows Network between Windows clients.

After learning Samba for a long time, I will share with you that you may encounter the Fedora Samba problem. After reading this article, you will certainly have a lot of GAINS. Here we will introduce the solution to the Samba ora Samba problem, I hope this article will teach you more things. When we use Windows as the client, we usually need to share files and print files.

As one of Windows Network functions, these requirements can usually be achieved between Windows clients through the features inherent in Windows Network. However, with Samba ora Samba, we can also enable a Fedora host to be compatible with the Windows Network to achieve the same functionality, so as to make full use of the availability of the Fedora host.

This article mainly introduces how to share files in a Windows network through the construction of the Samba ora Samba server. The SMB protocol is an application protocol built on the NetBIOS protocol. It is a service based on two ports, TCP138 and 139. After NetBIOS appears, Microsoft uses NetBIOS to implement a network file/print service system. This system sets a 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, allows different computers to share printers and files.

Therefore, to integrate Windows with Unix/Linux computers, the best way is to install software that supports SMB on Unix/Linux computers. In this way, you can use shared resources on Unix/Linux computers like Windows NT or Windows 2000 servers without changing the settings on Windows clients.
Fedora Samba enables SMB to run on the NetBIOS protocol, and uses the NetBEUI protocol of Windows to allow Unix/Linux servers to be accessed on Windows Network neighbors.

Install Samba ora Samba

First, install Samba ora Samba online through yum.
Yum-y install Fedora Samba

Configure Fedora Samba

Then, configure Fedora Samba as needed by editing/etc/Fedora Samba/smb. conf. Here, the principle of this article is to only apply file sharing to the Intranet and give the directory to be shared full read/write permissions.

Root@www.linuxidc.com ~ # Vi/etc/Samba/smb. conf configure edit the configuration file of Samba ora Samba
Workgroup = WORKGROUP // set a Working Group
Server string = % U's Samba % v // description % U indicates the current Login User
Netbios name = fedora // netbios name. fedora9 is not enabled by default.
Log file =/var/log/Samba/log. % m // log file storage PATH % m your windows Host Name
Max log size = 50 // maximum log capacity
Security = user // security level. The user must have the user name and password, but not the share level.
[Fedora Samba] // create a share named Fedora Samba
Comment = Samba // description
Path =/home/suyang/Fedora Samba // shared path
Public = no // whether to allow access by the guest user (equivalent to guest OK = yes/no)
Writable = yes // whether to write
Write list = suyang // list of users that can be written (@ represents the user group)

Next, create a dedicated directory that will be shared to the Windows Network through Samba ora Samba.

Root@www.linuxidc.com ~ # Mkdir/home/suyang/Samba plugin create a dedicated directory for shared files
Root@www.linuxidc.com ~ # Chown-R nobody./home/suyang/Samba examples
Root@www.linuxidc.com ~ # Chmod 777/home/suyang/Samba connector set the private Directory attribute to 777

Before connecting to the server, you must set the user used to log on to Samba ora Samba in advance. Here, we use the "smbpasswd" tool of the Samba ora Samba-standard Samba ora Samba user database management tool as an example to create user data for logging on to Samba ora Samba. Note: The premise of using smbpasswd to create a user is that the user exists in the System user. Only the user information in the Samba ora Samba user database can be created based on the System user.

Root@www.linuxidc.com ~ # Smbpasswd-a suyang Users Add the System user suyang (example) to the Samba ora Samba user database
New SMB password: Login enter the password used by the user to log on to Samba ora Samba
Retype new SMB password: Confirm again to enter the password

Start the Samba ora Samba service

Before starting the Samba ora Samba service, open the port used by Fedora Samba in the firewall settings. Root@www.linuxidc.com ~ # Vi/etc/sysconfig/iptables configure edit the iptables configuration file
-A RH-Firewall-1-INPUT-m state -- state NEW-m tcp-p tcp -- dport 25-j ACCEPT rows find this row and add the following lines 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 138-j ACCEPT
Root@www.linuxidc.com ~ #/Etc/rc. d/init. d/iptables restart iptables to bring the new rule into effect
Flushing firewall rules: [OK]
Setting chains to policy ACCEPT: filter [OK]
Unloading iptables modules: [OK]
Applying iptables firewall rules: [OK]

Finally, start the Samba ora Samba service (including two Daemon Processes: smb and nmb ).

Root@www.linuxidc.com ~ # Chkconfig smb on startup set Fedora Samba to start automatically
Root@www.linuxidc.com ~ # Chkconfig -- list smb restart confirm the Samba ora Samba startup label and check that 2-5 is in the on status

Smb 0: off 1: off 2: on 3: on 4: on 5: on 6: off
Root@www.linuxidc.com ~ # Chkconfig nmb on startup
Root@www.linuxidc.com ~ # Chkconfig -- list nmb enabled confirm the nmb startup tag, and confirm that 2-5 is in the on status
Nmb 0: off 1: off 2: on 3: on 4: on 5: on 6: off
Root@www.linuxidc.com ~ #/Etc/rc. d/init. d/smb start restart start the Samba ora Samba service
Starting SMB services: [OK]
Root@www.linuxidc.com ~ #/Etc/rc. d/init. d/nmb start worker start nmb Service
Starting NMB services: [OK]

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.