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 Server in RHEL 5

2025-02-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article will explain in detail how to build a Samba server for RHEL 5. The content of the article is of high quality, so the editor shares it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.

The construction of Samba under RHEL 5 is relatively easy compared with other systems. Here is a simple description of the construction process of Samba under RHEL 5, and a simple comparison with the construction of Samba servers in other systems.

To share files with the windows operating system in RHEL 5, you can use nfs on RHEL 5, but you must install the relevant software on windows, and the software generally requires a fee! Therefore, this method is not practical, is there a better solution? The answer is yes, and this more practical method will be introduced in detail below.

Network file sharing between windows hosts is realized by using Microsoft's own CIFS service. CIFS is the abbreviation of CommonInternetFileSystem, which can directly access the shared folders of other hosts in the network from a windows host. The most typical application of CIFS is to find other hosts in the "network neighbor" and access the shared files.

For a long time, windows hosts have used SMB/CIFS network protocol to realize the sharing of files and printing resources. Because SMB/CIFS is Microsoft's proprietary protocol, it was impossible to communicate directly with the RHEL 5 system until the advent of the Samba project. Through the construction of Samba under RHEL 5 and Samba client software, the two-way file sharing between RHEL 5 host and widows host can be realized.

Here is a brief introduction to the process of building Samba under RHEL 5:

◆ [root@Linserv~] # rpm-qa | grepsamba

◆ [root@Linserv~] # mount/dev/cdrom/mnt

Mount:blockdevice/dev/cdromiswrite-protected,mountingread-only

◆ [root@Linserv~] # rpm-ivh/mnt/Server/samba-3.0.23c-2.i386.rpm

Warning:/mnt/Server/samba-3.0.23c-2.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186

Error:Faileddependencies:

Samba-common=0:3.0.23c-2isneededbysamba-3.0.23c-2.i386

◆ [root@Linserv~] # eject

◆ [root@Linserv~] #! mou

Mount/dev/cdrom/mnt

Mount:blockdevice/dev/cdromiswrite-protected,mountingread-only

◆ [root@Linserv~] # rpm-ivh/mnt/Server/samba-common-3.0.23c-2.i386.rpm

Warning:/mnt/Server/samba-common-3.0.23c-2.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186

Preparing...### [100%]

1:samba-common### [100%]

◆ [root@Linserv~] # mount/dev/cdrom/mnt

Mount:blockdevice/dev/cdromiswrite-protected,mountingread-only

◆ [root@Linserv~] # rpm-ivh/mnt/Server/samba-3.0.23c-2.i386.rpm

Warning:/mnt/Server/samba-3.0.23c-2.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186

Preparing...### [100%]

1:samba### [100%]

◆ [root@Linserv~] # vi/etc/samba/smb.conf

[global]

Workgroup=MYGROUP

Serverstring=SambaServer

Security=user

Loadprinters=yes

Cupsoptions=raw

Logfile=/var/log/samba/%m.log

Maxlogsize=50

Dnsproxy=no

[homes]

Comment=HomeDirectories

Browseable=no

Writable=yes

[printers]

Comment=AllPrinters

Path=/usr/spool/samba

Browseable=no

Guestok=no

Writable=no

Printable=yes

[public]

Path=/home/public

Public=yes

Onlyguest=yes

Writeable=no

◆ [root@Linserv~] # servicesmbstart

StartingSMBservices: [OK]

StartingNMBservices: [OK]

◆ [root@Linserv~] # mkdir/home/public

◆ [root@Linserv~] # chownnobody:nobody/home/public/

◆ [root@Linserv~] # vi/home/public/test.doc

◆ [root@Linserv~] # useraddsamba1

◆ [root@Linserv~] # useraddsamba2

◆ [root@Linserv~] # tail/etc/passwd

Rpc:x:32:32:PortmapperRPCuser:/:/sbin/nologin

Sshd:x:74:74:Privilege-separatedSSH:/var/empty/sshd:/sbin/nologin

Rpcuser:x:29:29:RPCServiceUser:/var/lib/nfs:/sbin/nologin

Nfsnobody:x:65534:65534:AnonymousNFSUser:/var/lib/nfs:/sbin/nologin

Pcap:x:77:77::/var/arpwatch:/sbin/nologin

A:x:500:500::/home/a:/bin/bash

B:x:501:501::/home/b:/bin/bash

Virtual:x:502:502::/home/ftpsite:/bin/bash

Samba1:x:503:503::/home/samba1:/bin/bash

Samba2:x:504:504::/home/samba2:/bin/bash

◆ [root@Linserv~] # cat/etc/samba/smbpasswd

◆ [root@Linserv~] # smbpasswd-asamba1

NewSMBpassword:

RetypenewSMBpassword:

Addedusersamba1.

◆ [root@Linserv~] # smbpasswd-asamba2

NewSMBpassword:

RetypenewSMBpassword:

Addedusersamba2.

◆ [root@Linserv~] # cat/etc/samba/smbpasswd

Samba1:503:CCF9155E3E7DB453AAD3B435B51404EE:3DBDE697D71690A769204BEB12283678: [U]: LCT-4921594C:

Samba2:504:CCF9155E3E7DB453AAD3B435B51404EE:3DBDE697D71690A769204BEB12283678: [U]: LCT-4921595B:

◆ [root@Linserv~] # mount/dev/cdrom/mnt

Mount:blockdevice/dev/cdromiswrite-protected,mountingread-only

◆ [root@Linserv~] # rpm-ivh/mnt/Server/samba-client-3.0.23c-2.i386.rpm

Warning:/mnt/Server/samba-client-3.0.23c-2.i386.rpm:HeaderV3DSAsignature:NOKEY,keyID37017186

Preparing...### [100%]

1:samba-client### [100%]

◆ [root@Linserv~] # umount/mnt

◆ [root@Linserv~] # mount-ousername=administrator//192.168.0.21/Inetpub/mnt

Password:

◆ [root@Linserv~] # ls/mnt

AdminScriptswwwroot

◆ [root@Linserv~] #

The above is through the construction of Samba under RHEL 5 to complete the communication between windows and RHEL 5 system, so the construction of Samba under RHEL 5 is very important for RHEL 5.

On how to build RHEL 5 Samba server to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

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