SSH cannot connect to the remote Ubuntu solution

Source: Internet
Author: User
Tags openssh server

Recently, plagued by the inability to telnet to the newly installed Ubuntu virtual machine on VMware, the problem is now found, so the solution to record this problem for later use.


One, the preparation of remote login virtual machine:

Ubuntu Virtual Machine Network should choose bridged (bridge mode), you can configure the static IP in Ubuntu, or use the router (your own WiFi connection, configured through the wireless router) through the DCHP server IP address assignment (general configuration no longer change, Address is assigned by MAC address recognition unless the IP address is exhausted). There are several ways to connect with VMware:Bridge, Nat, host-only differences in VMware

About configuring the NIC, you can configure it in VMware's Edit->virtual network editor.

P.s. In the Ubuntu system, you can use the command #ifup {interface} and #ifdown {interface} to turn on and off the associated network card. However, if you set the ifconfig eth0 or modify the network interface, you will no longer be able to shut down in the Ifdown eth0 way. Because Ifdown will analyze the current network parameters and ifcfg-eth0 whether the match, if not, will give up this operation. Therefore, after you have modified with ifconfig, you should ifconfig eth0 down to be able to close the interface.


second, about the remote host (Ubuntu) on some configuration:

The Openssh-server software must be installed so that you can connect to the Ubuntu virtual machine via SSH.

installation command: sudo apt-get install openssh-server.

Sudo/etc/init.d/ssh Restart (restart SSH service)

For specific reference: Install OpenSSH server under Ubuntu and connect to Ubuntu remotely on the client

Now, after installing Openssh-server, you can run the command: Netstat-an | grep 22 or Ps-e |grep SSH

To see if Port 22 is in the listen state or if the SSH service is already running, if so, then SSH on the Ubuntu host is already configured.


third, Xshell connected to the remote host Ubuntu:

Follow the prompts, gradually configure, port number selection 22, personalized configuration, you can log in remotely.


P.S.

1, in order to Xshell normal display in Chinese, we want to change the Xshell encoding method to UTF8 . The specific actions are:

[file]–>[open]–> Select the connection in the open session, click [Properties], [Terminal], on the right translation first select UTF8, and then reconnect the server.

2. How to transfer files on Windwos to Linux on a virtual machine

Law One:

Input Rz–help

If the program "RZ" is not installed. You can use the following command to install:

sudo apt-get install Lrzsz

Switch to the directory where you want to store the file

File->transfer->send ZMODEM, a dialog box appears, select the files you want to transfer.

Law II:

Use PSCP (a binder of putty) to implement file transfer.


In addition, individuals talk about some of the benefits of using remote login methods:

1, can be personalized configuration terminal;

2, the virtual machine does not have to run in the graphical interface;

3, the operation is simple, as in the system terminal operation;

4, transfer files is very simple, in addition, you can use paste copy, which is very convenient.

SSH cannot connect to the remote Ubuntu solution

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: info-contact@alibabacloud.com 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.