Implement host access to the virtual machine (CentOS) folder

Source: Internet
Author: User
When learning CENTOS, there is always a data exchange problem between the host and the virtual machine. of course, some people think that installing VMTOOLS can solve all the problems. However, I personally do not like to use the desktop version when using Linux, so vmtools is a fart for me, and VMtools is relatively large, which is also troublesome to install. I don't think it is necessary. The following examples are original. if you need to reprint them, please indicate the source.
When learning CENTOS, there is always a data exchange problem between the host and the virtual machine. of course, some people think that installing VMTOOLS can solve all the problems. However, I personally do not like to use the desktop version when using Linux. Therefore, vmtools is a 'fart 'for me. In addition, VMtools is relatively large and installation is troublesome. I don't think it is necessary.
Some people also say that setting up an ftp is a good thing, but ftp requires tools. of course, if you are a great character, you can use the cmd console to complete ftp, however, I am not a huge fan, so I have to be stupid. In Linux, file sharing involves a lot of software, such as samba and VSFTPD. I have already created these two types. in the Internet, vsftpd is of course very convenient, but in the LAN, if you use ftpd for transmission, it will be quite useless. if you are not talking about it, configure the samba server.
Before configuring, let me first talk about the failure of using the nat method in the test. However, the briges method is used successfully, the following are my configurations (prerequisites for all networks ).
# Yum install samba # install samba software
# Vi/etc/samba/smb. conf # Edit the configuration file
Next, you need to modify the working group and find the location as shown in:
Set wokrgroup = ******* # ********* as the working group of windows.
Server string = ******* # this can be written as needed.
Hosts allow = 127. 192.168.1. # for security reasons, it indicates that only local access or LAN access is allowed.
Next, press the exit key and enter G in upper case to jump to the end of the configuration file and write the code as shown in:
Path = *** 8 indicates the directory to be shared.
Create mask # indicates that the permission for the created file is 744. of course, you can change it to 644.
Directory mask # permission for creating folders 755 why is 755 actually the folder must be executable and browsed before it can be opened, so it is 5 (r-x)
Others are not explained. it is very simple.
Next, let the user access the folder. assume that the user is test (ensure that the user already exists and the user does not exist. create a folder)
Create User
# Useradd test
# Passwd test
Set samba access password
# Smbpasswd-a test # note that-a must be filled in; otherwise, the password cannot be set.
Restart SAMBA Server
# Service samba restart
Here I would like to explain why I still cannot access the server according to the configuration. This may be related to the firewall and selinux. you can try it, close selinux and iptables to access the/var/ftp/pub/smbdir folder in the virtual machine.

Connection: http://www.crazyant.cn/thread-225-1-1.html

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.