[PE] Remotely log in to the linux system (CentOS/Ubuntu) connected to the virtual machine via telnet through SecureCRT

###Date: 2017/9/17

###Author:  SoaringLee

1. Inscription

        I had nothing to do at home on weekends, thinking that I had installed SecureCRT before, I tried to use this software telnet to connect to the linux system in the virtual machine. CentOS was installed in the virtual machine VMvare Workstation before, and now I try to use the desktop linux system Ubuntu for testing.

2. Prepare materials

Virtual machine: VMvare Workstation
Linux system: Ubuntu
Remote login software: SecureCRT

3. Steps (here, the ubuntu system is used as an example)

1. The first is to set the network connection method used by Ubuntu in the virtual machine to host-only mode (host-only), which shares the private network with the host.
2. Check the network connection settings of the host, and find the three connections as shown in the figure

                         

Among them, VMnet8 is related to the NAT method, which is not discussed in this article. Here VMnet1 is related to host-only. Set the ip of VMnet1 as follows, where "177" can be replaced with any non-conflicting subnet, and 1It cannot be changed. The 1 here represents the IP in the subnet assigned to the host, that is, after the virtual machine ping192.168.177.1 is completed, the host will be pinged.


3. Log in to the Ubuntu system and use the ifconfig command to check the IP address of the ens33 network card or eth0 network card:

Note: It is necessary to set the IP address of the ubuntu system in the virtual machine and the IP address of the host in the same network segment, which has been set in the figure.
If it is not in the same network segment, you can use the following two methods to modify the IP address:
(1) Modify the host IP address, modify the IP address in VMnet1 and the IP address in ubuntu to be in the same network segment;
(2) Modify the IP address in the virtual machine ubuntu and the host IP in a network segment;

The sign of successful modification is that the ubuntu system in the host and the virtual machine can ping each other.
The host pings the ubuntu system in the virtual machine:


The ubuntu system in the virtual machine pings the localhost:


4. Check whether the Ubuntu system in the virtual machine is installed with the ssh service and client. This is more important.

Check the install SSH statement: "rpm -aq|grep openssh-server"

If it is not installed ( Ubuntu does not install ssh by default) openssh-server, you need to find other ways to install it, such as downloading rpm from the host, or installing the rpm package with iso (refer to other articles); root password, execute the "sudo passwd root" statement to modify the root password), switch root permissions to check the SSH service statement: if there is a process ID, it means that it has been started.

How to install ssh-server and ssh-client: sudo apt install ssh-server ssh-client


5. Open SecureCRT, set the login hostname (the IP address of the virtual machine ubuntu system), the ssh2 port is 22, and the Firewall is set to none. Then you can open and enter the account and password of the ubuntu system, and then you can log in successfully!

    It is really cool to use SecureCRT to access and operate the linux system, and it is no longer limited by the small space of the virtual machine.


Note: The virtual machine can be interconnected with the host, but cannot use the virtual machine to access the Internet. This is a limitation of the host-only mode. To download the required installation package online, switch to NAT mode or bridge mode.

For the three network modes in the virtual machine, please refer to: http://www.linuxidc.com/Linux/2016-09/135521.htm


Reference: http://blog.csdn.net/lzx_bupt/article/details/6738186

           http://www.cnblogs.com/xiazh/archive/2010/08/13/1798844.html



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325991182&siteId=291194637