How to connect the local Windows server to CentOS in the Virtual Machine and centos in the Virtual Machine

Source: Internet
Author: User

How to connect the local Windows server to CentOS in the Virtual Machine and centos in the Virtual Machine

1. Determine the IP address of CentOS. The command is ifconfig. We can see that the LinuxIP address is


2. the IP address of WIndows is,


3. Ensure the ping between CentOS and Windows




4. Disable CentOS Firewall

(Note: The following versions are earlier than centos 7.

  If no iptables exists in CentOS, run the following command to install the Firewall:

Yum install-y iptables-services

Etc/init. d/iptables stop)


The firewall of CentOS7 uses firewall by default, which is different from the previous version using iptables. Configure the firewall as follows:

1. Disable the Firewall:sudo systemctl stop firewalld.service

2. Disable startup:sudo systemctl disable firewalld.service


5. Check whether the ssh installation package is installed. CentOS is a visitor, so you need to install the ssh-server Installation Package. (If NO output is displayed, it indicates that the installation is not performed.Openssh-server, InputYum install openssh-serverAs shown in.

Command: rpm-qa | grep ssh

6. Find the sshd_config file in the/etc/ssh directory and modify some parameters.


Remove the comment of the port and listening address, allow remote logon, and enable user name and password for connection verification.




7. Enable sshd service and service sshd start


8. Check whether sshd is enabled, ps-e | grep sshd


Or check whether port 22 is listened on. netstat-an | grep 22


9. If all the above preparations are successful, we can try to connect. After configuration, you can access the Centos of the Virtual Machine in windows. Congratulations! We have taken the first step ~


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: 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.