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 192.168.85.128.
2. the IP address of WIndows is 192.168.16.1,
3. Ensure the ping between CentOS and Windows
Ping 192.168.16.1
Ping 192.168.85.128
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 ~