Simple example of file sharing between multiple platforms in Linux (RedHat)

Source: Internet
Author: User
Simple example 1 of file sharing between multiple platforms in Linux (RedHat). Samba is installed in detail in Linux to share resources between Windows hosts and Linux servers. the Linux operating system provides the Samba service, the Samba service builds a bridge between two different operating systems, enabling Linux...
Simple example 1 of file sharing between multiple platforms in Linux (RedHat). Samba is installed in detail in Linux to share resources between Windows hosts and Linux servers. the Linux operating system provides the Samba service, the Samba service builds a bridge between two different operating systems, enabling communication between Linux and Windows systems and providing great convenience for a wide range of Linux enthusiasts. This article briefly introduces how to set up a Samba server and simple configuration on a Linux operating system. Www.2cto.com
1. by default, the Linux system has installed part of the Samba service package in the default installation. to have a complete understanding of the entire process, uninstall this part first. Run the command rpm-qa | grep samba to find two existing packages by default: samba-client-3.0.33-3.7.el5samba-common-3.0.33-3.7.el52, uninstall Samba, and uninstall both packages with rpm-e. For the samba-common-3.0.33-3.7.el5, because there is a dependency between it and other rpm packages, the parameter-f and -- nodeps must be added,-f is mandatory, -- nodeps is not checked dependency, complete command: rpm-e samba-common-3.0.33-3.7.el5-f -- nodepsrpm-e samba-client-3.0.33-3.7.el5-f -- nodeps 3. install Samba with the following command: rpm-ivh samba-3.0.33-3.29.el5_6.2.i386.rpm-f -- nodepsrpm-ivh samba-client-3.0.33-3.29.el5_6.2.i386.rpm-f -- nodepsrpm-ivh samba-common-3.0.33-3.29.el5_6.2.i386.rpm-f -- after nodeps installation is complete, use the command r Pm-qa | grep samba: check that all the servers on which the samba server is built have been installed. Www.2cto.com
4. configure smb. the Samba configuration file of the conf file is generally stored in the/etc/samba Directory. The main configuration file name is smb. conf, which records a large amount of rules and shared information. Therefore, it is a very important core configuration file for the samba service. most of the main configurations for completing samba server setup are carried out in this file. The working principle of the Samba server is that the client initiates a request to the Samba server to access the shared directory. The Samba server receives the request and queries the smb. conf file to check whether the shared directory exists and the visitor's access permissions. if the visitor has the corresponding permissions, the client is allowed to access it, finally, the system information and user access behavior information collected during access are stored in the log file. Step 1: modify the configuration file. first, back up the samba configuration file cd/etc/sambamv smb. conf smb. confbak and create a new smb. conf file touch smb. conf and then we write this section into smb. [global] workgroup = linuxsir netbios name = LinuxSir05 server string = linux samba server testserver guest OK = yes security = SHARE [linuxsir] path =/opt/sambadir writeable = yes browseable = yes guest OK = yes www.2cto.com annotation: [global] this section is a global configuration and is required. There are the following lines: workgroup is the working group displayed in Windows; here I set LINUXSIR (in upper case); netbios name is the computer name displayed in Windows; server string is the Samba server description, which can be defined by yourself. this is not important. security is the authentication and logon method. here we use share. There are many verification methods, this is one of them; the other is commonly used for user authentication; if share is used, there is no need to set the user and password; [linuxsir] the shared directory is displayed in Windows. path = can be used to set the directory to be shared; writeable can be written, I set it to writable; browseable can be viewed, yes; browsing means that we can see shared folders under the working group. If you do not want to display it, set it to browseable = noguest OK. an anonymous user logs on as a guest user;
Step 2: create a directory and grant permissions; [root @ localhost ~] # Mkdir-p/opt/linuxsir [root @ localhost ~] # Id nobodyuid = 99 (nobody) gid = 99 (nobody) groups = 99 (nobody) [root @ localhost ~] # Chown-R nobody: nobody/opt/linuxsir Note: For nobody authorization, we first use the id command to view the information of the nobody user and find that the user group is also nobody, we must take this as the standard. In some systems, the nobody user group is not the nobody. Step 3: Start the smbd and nmbd servers; [root @ localhost ~] # Service smb start [root @ localhost ~] # Service smb stop [root @ localhost ~] # Service smb restart in redhat, you can start the samba service during boot. Chkconfig -- level 345 smb on 2. install the NFS file server www.2cto.com in Linux and configure the following in the/etc/exports file on the server:/opt/nfsdir 172.16.245.0/24 (rw, insecure, sync, no_subtree_check, no_root_squash) start and stop the NFS service [root @ localhost ~] # Service nfs start [root @ localhost ~] # Service nfs stop [root @ localhost ~] # Service nfs restart in redhat, you can start the NFS service during boot. Chkconfig -- level 345 nfs on mounting the NFS file system on another Linux Machine [root @ localhost root] # mount-t nfs 172.16.245.103: /opt/nfsdir/mnt/nfs/umount/mnt/nfs/author kkdelta
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.