In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces how to share files between Windows and Linux CentOS7). The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
After tossing about for several days, I finally got it. I thought I could drag it directly into the virtual machine, but I kept talking about the decompression error. After looking at the file size, I found that it was only the original 1/10, so there must have been a mistake in the process of transmission. After searching for the solution, you cannot copy and paste directly. The search found that there are three ways:
Install samba
Set up the VMware shared directory
Install FTP or SSH software in window.
What I am mainly talking about is the first method, and the second one I tried by myself, but it was unsuccessful, and then I officially started the installation!
First, install Samba
Check if samba is installed
[root@localhost ~] # rpm-qa | grep samba
Samba-common-4.9.1-6.el7.noarch
Samba-client-4.9.1-6.el7.x86_64
Samba-4.9.1-6.el7.x86_64
Samba-client-libs-4.9.1-6.el7.x86_64
Samba-common-tools-4.9.1-6.el7.x86_64
Samba-common-libs-4.9.1-6.el7.x86_64
Samba-libs-4.9.1-6.el7.x86_64
Note: I have already installed, so there will be the above display, if not installed, there is no above display. Generally, when you install CentOS 7, you will default to the installation package of Samba, so you only need to execute the following command:
Yum-y install samba samba-client samba-common
This command installs both Samba and client samba-client, so check the installation again and the result will be the same as mine, only the version number is different.
[root@localhost ~] # rpm-qa | grep samba
Samba-common-4.9.1-6.el7.noarch
Samba-client-4.9.1-6.el7.x86_64
Samba-4.9.1-6.el7.x86_64
Samba-client-libs-4.9.1-6.el7.x86_64
Samba-common-tools-4.9.1-6.el7.x86_64
Samba-common-libs-4.9.1-6.el7.x86_64
Samba-libs-4.9.1-6.el7.x86_64
2. Configure samba
1. Close SELINUX
[root@localhost ~] # vi / etc/sysconfig/selinux
As follows:
Modify the scarlet letter below
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing-SELinux security policy is enforced.
# permissive-SELinux prints warnings instead of enforcing.
# disabled-No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three two values:
# targeted-Targeted processes are protected
# minimum-Modification of targeted policy. Only selected processes are protected.
# mls-Multi Level Security protection.
SELINUXTYPE=targeted
3. Turn off the firewall
[root@localhost ~] # systemctl disable firewalld
Removed symlink / etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink / etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
4. Restart the computer
[root@localhost] # shutdown-r now
5. Create a shared directory
[root@localhost home] # mkdir-p / home/share/software
6. Create a shared user group
[root@localhost home] # groupadd share
7. Create a shared user
[root@localhost home] # useradd-g share-s / sbin/nologin share
8. Set shared directory permissions
[root@localhost home] # chown-R share:share / home/share/software
9. Modify shared user password
[root@localhost home] # / bin/smbpasswd-a share
New SMB password:
Retype new SMB password:
Added user share.
10. Modify samba configuration file
[root@localhost share] # vi / etc/samba/smb.conf
11. The configuration file is described as follows
[global] # Global variable
? Workgroup = WORKGROUP # working group
? Security = user # Log in to access the share
? Passdb backend = tdbsam
? Printing = cups
? Printcap name = cups
? Load printers = yes
? Cups options = raw
[software] # shared directory name displayed
? Path = / home/share/software # shared directory path
? Comment = Software Directories # shared directory description
? Writeable = Yes # shared directory writable
? Write list = share # user with write permission
? Valid users = share # users of the shared directory
? Browseable = Yes # whether the file can be browsed
? Whether read # is read-only
? Inherit acls = No
Note: when you write, you can copy the content in [software] above, but you must delete the content after #, here is to tell you what it is used for, do not take these notes in the actual file, or you will report an error! I just didn't know at the beginning, which led to the mistake!
twelve。 After modifying the configuration file, you need to run it first (this is the command to check whether there is any error in smb.conf):
[root@localhost home] # testparm
To see if there are any mistakes, the following error I reported earlier:
Error one:
Rlimit_max increasing rlimit_max (1024) to minimum Windows limit (16384)
If you see the above error, you must continue to make the following corrections:
[root@localhost ~] # vim / etc/security/limits.conf
Root-nofile 16384
Root means that if root users want all users to be effective, just replace root with *! I set it * here are the contents of the configuration file
\ # subdirectory, but a user specific setting here can be overriden only
# with a user specific setting in the subdirectory.
#
# Each line describes a limit for a user in the form:
#
#
#
# Where:
# can be:
#-a user name
#-a group name, with @ group syntax
#-the wildcard *, for default entry
#-the wildcard%, can be also used with% group syntax
# for maxlogin limit
*-nofile 16384
#
# can have the two values:
#-"soft" for enforcing the soft limits
#-"hard" for enforcing hard limits
#
# can be one of the following:
#-core-limits the core file size (KB)
#-data-max data size (KB)
#-fsize-maximum filesize (KB)
#-memlock-max locked-in-memory address space (KB)
Error 2:
Set_variable_helper (Yes # shared directory writable): value is not boolean! Error loading services.
This error is what I said before, did not delete the # and the comments after #, of course, do not delete the first few lines with the #!
13. Give various permissions to the shared directory (once set up here, there will be no permission problem!)
[root@localhost ~] # chmod 777 / etc/samba
[root@localhost ~] # chmon 777 / etc/samba
14. Start the samba service
[root@localhost share] # systemctl start smb
15. Set the samba service to boot automatically
[root@localhost share] # systemctl enable smb
Created symlink from / etc/systemd/system/multi-user.target.wants/smb.service to / usr/lib/systemd/system/smb.service.
On how to share files between Windows and Linux CentOS7) so far, I hope the above content can be of some help to you and 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.
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.