SSH cannot connect to the remote Ubuntu solution

Source: Internet
Author: User
Tags openssh server

Recently, the problem is now discovered by the inability to telnet to the newly installed Ubuntu virtual machine on VMware. Therefore, the resolution of this problem is recorded for later use.


One, the preparation of remote login virtual machine:

Ubuntu virtual machines should be networked by choosing bridged (bridging mode), being able to configure a static IP in Ubuntu, or using a router that uses a WiFi connection Configured via the wireless router) IP address assignment through Dchpserver (the general configuration is no longer changed and the address is assigned by MAC address recognition unless the IP address is exhausted). 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, assuming the ifconfig eth0 to set or change the network interface, it can no longer be ifdown eth0 way to shut down. Because Ifdown will analyze the current network and ifcfg-eth0 whether the match, if the hypothesis does not match, will abandon this operation. So. After you have finished using ifconfig changes, you should ifconfig eth0 down to close the interface.


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

The Openssh-server software must be installed so that you are able to connect to an Ubuntu virtual machine via SSH.

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

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

More details: Install OpenSSH server under Ubuntu and connect to Ubuntu remotely from the client

Now. After installing Openssh-server, can execute command: Netstat-an | grep 22 or Ps-e |grep SSH

See if 22port is in the listen state or if the SSH service has been executed, assuming yes. It means that SSH is already configured on the Ubuntu host.


third, Xshell connected to the remote host Ubuntu:

Follow the prompts to step through the configuration, port number select 22. After personalization, you can log in remotely.


P.S.

1, in order to display the normal Chinese in the Xshell. We're going to change the Xshell encoding to UTF8. Detailed actions are:

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

2, how to transfer files on the Windwos to Linux on the virtual machine

Law One:

Input Rz–help

Assume that the program "RZ" has not been installed.

You can use the following command to install:

sudo apt-get install Lrzsz

Switch to the folder where you want to store the files

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

Law II:

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


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

1, can be personalized configuration terminal;

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

3, simple operation. As if operating on the system terminal.

4, transfer files very easy. In addition, you can use paste copy. This 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.