It’s the first time I use xshell, but I can’t connect to Linux. I tried it for a long time and searched many solutions, but finally I solved it. Here I will share my solution and list the solutions on the Internet. I hope it can be solved. Help others.
The IP address is not configured. You need to configure it yourself. There are many configuration methods on the Internet. Here is one:
Enter vim /etc/sysconfig/network-scripts/ifcfg-eth0command
Change the content of this file to the following:
Set the ip yourself, for example: 192.168.1.155
Then enter ifconfig -a to find your own IP and change it.
This method on the Internet is very complicated, but it is similar, but I tried it myself, (>_ The picture below is my own adapter settings:
After I change this, xshell can connect to linux.
NAT connection mode: http://blog.csdn.net/exziro/article/details/52969305
The meaning of various modes is given here (content comes from: http://blog.csdn.net/u012454079/article/details/48522611):
NAT mode: All data accessed by the virtual machine on the network is provided by the host, and the virtual machine does not really exist. In this way, the virtual machine can access the host and other hosts on the network, but the host cannot access the virtual machine, and each virtual machine is independent and cannot access each other
Bridge mode: Bridge access sets up a bridge through the host's network card to directly connect to the network. Such a virtual machine is assigned an independent IP. In this way, the virtual machine and the host can access each other through IP.
Internal network mode: Internal network mode disconnects the virtual machine from the external network and only implements the internal network between virtual machines.
service ssh start
Enter the following command:
service iptables stop chkconfig iptables off
Write your own experience here, I hope it can help you.
The above is the detailed content of Ideas to solve the problem that Xshell cannot connect to the virtual machine. For more information, please follow other related articles on the PHP Chinese website!