Under VMware, Windows7 and Linux7/centos7 share settings

Source: Internet
Author: User
Tags scp command ssh secure file transfer ssh secure shell

Under VMware, Windows7 is ready to share settings with LINUX7/CENTOS7:

1:vmware Workstation 12, create a new two virtual machine: Windows7 and linux7 (CentOS7)

Win7 ip:192.168.232.170, the D-Disk share directory is: sharewindows, login User: admin, Password: L1236669

LINUX7 ip:192.168.232.171, shared directory:/sharelinux, login User: Lizhie, Password: L1236669

2: Make sure the linux7 (CentOS7) is installed under: samba-client,

Check to see if Samba is installed:

Yum Info samba-client

Yum List samba-client

Rpm-qa | grep Samba


[LINUX7]

[Email protected] share]$ Rpm-qa |grep Samba

Samba-client-4.2.3-10.el7.x86_64

Samba-common-tools-4.2.3-10.el7.x86_64

Samba-common-libs-4.2.3-10.el7.x86_64

Samba-libs-4.2.3-10.el7.x86_64

samba-client-libs-4.2.3-10.el7.x86_64

samba-common-4.2.3-10. El7.noarch

[Email protected] share]$

3: Because the firewall and the SELinux configuration are not yet in the meantime, some of the following methods will be restricted by their actions, so turn it off first

command to turn off the firewall: service iptables stop
Close selinux command: Setenforce 0

I. Implementing folder sharing between Linux and Windows
Directions: Windows Access Linux
Method 1: Use third-party software
1, modify the configuration file: Vi/etc/ssh/sshd_config, mainly to the port this parameter uncomment, other parameters can be modified according to the circumstances.
2. Restart the SSH service: service sshd restart
3, install the SSH secure SHELL under Windows, after successful installation there is a child program ssh secure File Transfer Client, open and enter:
hostname:192.168.232.171 (can be written as a Linux hostname if you have a DNS service)
PORT:22 (default value, can be modified to other values)
Username:lizhie (can also be another account under Linux)
password:l1236669

After the connection is successful, you can upload and download files to Linux under Windows.

Method 2:samba Sharing
1. Install Samba: You can first check if the installation is installed: RPM-QA | grep samba, without the words to install it yourself, here is an on-line installation mode based on RPM package Yum
Yum is a quick-install mode that automatically solves the dependencies of software installation and automatically downloads the appropriate software for installation on a specific server, with simple commands: Yum installs Samba, which is fast and easy behind the programmer's hard work!
2, create the shared folder, this is Mkdir-m 777/home/def/share
3, modify the/etc/samba/smb.conf, the parameters in this is more, mainly
Workgroup = Workgroup (this is the Windows Workgroup mode, and there is a domain mode)
Hosts allow = 192.168.232.170 (can put the IP address to ask, when the Windows address is written here)
Then at the end of the file, add
[Public] (share name, which is the name that will be displayed when Windows is accessed)
Comment = Public Stuff (note)
Path =/home/def/sharelinux (share name)
Public = yes (open)
writable = yes (writable)
Of course, here are just some of the basic parameters, as well as other parameters according to the situation settings, such as garbled, and also specify the encoding format.
4. Restart the SMB Service: Service SMB restart
5, create Samba customer: Smbpasswd-a lizhie, enter the password will be prompted. This is the future remote host login required password, where the Lizhie account must be the system has an account, no words will be error, and then the new password is remote login password, this is the advantage of their password and remote login password separate.
6, Windows connection, start running, enter \\192.168.232.171, enter the SMB account password can be

Directions: Linux Access windows
Method One: Mount the shared folder
Execute Mount-o username=admin//192.168.232.170/sharewindows/mnt/sharelinux under Linux, enter password after carriage return, is Windows password L1236669

To be honest, this approach is well understood, and the simplest syntax is to mount commands. But it is the most confusing, because the partition format under Linux is Ext2\3\4, and Windows generally uses NTFS format, which is not recognized by Linux, and it can be mounted, and it can read the files. It's unbelievable.

Third, realize the folder sharing between Linux
Method One: Mount
1. Create a shared folder on a machine: Mkdir-m 777/home/share
2, modify the/etc/exports file, add a/home/sharelinux * (rw), this/home/sharelinux specify the share location, * on behalf of all the host, you can also write the IP address, RW is read-write
3. Restart NFS Services: Service NFS Restart
4, on the B machine mount: mount-t NFS 192.168.1.100:/home/sharewindows/mnt/sharelinux, enter the account password can be
5, the last is on the B machine to verify whether the Mount succeeds, command: DF
Method Two: Use the SCP command to transfer
This command is what I just learned yesterday, very simple operation Scp/home/sharelinux (source) 192.168.1.200:/home/sharewindows (Purpose), enter the password after entering, specifically see man SCP

Some articles are referenced from: http://www.linuxdiyf.com/viewarticle.php?id=311676


Under VMware, Windows7 and Linux7/centos7 share settings

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.