In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/03 Report--
Foreword:
It is reasonable to use smaba as a simple service, and it is not often used, it is not necessary to write a blog. However, there are still many holes encountered in this process, and after stepping on all of them, it feels that there is still a trace of necessity in recording them.
Text:
When it comes to file sharing, nfs basically meets the needs, but if you want to achieve file sharing between linux and windows, nfs cannot. Not to mention the samba service based on user authentication, I will mainly talk about how to achieve anonymous sharing, that is, no password is needed for windows access sharing or other linux access sharing.
The first step must be to install the necessary service first.
Yum install samba samba-client samba-comm
Smaba is the server program we want to use, samba-client literally means client program, and samba-comm mainly uses testparm syntax checking instructions.
Then start the service
Service smb start # obviously centos6 system, huh?
Then it is to write the configuration file. Our configuration file is divided into two parts: the global configuration under the identity of [global]. For the configuration of the samba itself, the configuration under the [shared resource name] specific shared resource name is the proprietary shared configuration. Let's first modify the global configuration.
[global] workgroup=xiaofengfeng # workgroup name security = share # share map to quest = Bad User # anonymously, which is important! The following is described in detail
Map to quest = Bad User this configuration is very important, with this configuration, windows can anonymously access the samba share, and will not prompt you for a password! It's very important. But if you use testparm, you will prompt Unknown parameter encountered: "map to quest", never mind it! The next step is to share the configuration!
[project] comment = smbuser's project path = / home/project # whether the directory path to share browseable = yes # can view this share. If it is set to no, it cannot be displayed on the client side. Read only = yes # is set to read-only and does not exist at the same time as writable If it exists at the same time, whether the last primary writable = yes # can be written to the file guest ok = yes in the shared directory
We can use the testparm command to ensure that the configuration is fine. The test output of the shared configuration test profile for bloggers is as follows:
[project] comment = smbuser's project path = / home/project read only = No guest ok = Yes
The next step is to restart the service and make sure that the permissions of / home/project allow nobody to read or write, make sure iptables releases the port of samba, and make sure that selinux has been shut down. These are all traps! To ensure access, make the following configuration:
Service restart smbiptables-Fsetenforce 0chomd 777 / home/project
You can limit the above permissions according to your ability. At this point, the sharing between windows and linux has been realized.
We can use smbclient-L\\ 127.0.0.1 to test whether the samba service is accessible. Prompt to enter the password and press the enter key directly. The output information is as follows:
Domain= [XIAOFENGFENG] OS= [Unix] Server= [Samba 3.6.23-33.el6] Sharename Type Comment-IPC$ IPC IPC Service (Samba Server Version 3.6.23-33.el6) project Disk smbuser's projectDomain= [XIAOFENGFENG] OS= [Unix] Server= [Samba 3.6.23-33.el6] Server Comment-Workgroup Master--
On Linux, you can mount shared files to a directory, such as
Mount-t cifs / / 172.16.254.182/project / mnt # 172.16.254.182 is the host of samba server
In windows, you can win+r to "run" and enter\\ 172.16.254.182 to access the linux share.
The win key is the start key.
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.