Home > System Tutorial > LINUX > body text

Ideas to solve the problem that Xshell cannot connect to the virtual machine

WBOY
Release: 2024-04-17 09:01:06
forward
1049 people have browsed it

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.

1, your Linux IP address is not configured.

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:
Ideas to solve the problem that Xshell cannot connect to the virtual machine
Set the ip yourself, for example: 192.168.1.155
Then enter ifconfig -a to find your own IP and change it.

2 Change your network adapter settings,

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:

Ideas to solve the problem that Xshell cannot connect to the virtual machine

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.

3, start ssh service

service ssh start

4, the firewall is not turned off (should be the last resort)

Enter the following command:

service iptables stop
chkconfig iptables off
Copy after login
5, please make sure your network can connect normally

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!

source:linuxprobe.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!