Install and configure SSH in Ubuntu (ssh: connecttohostlocalhostport22: Connectionrefused)

Source: Internet
Author: User
Why Install SSH? After Hadoop is started, namenode starts and stops various daemon on each node through SSH (SecureShell. As a cainiao, the first time I used Hadoop, the installation and configuration was a bit complicated. When I went to Ubuntu to configure SSH, there was a problem. After thinking about it, I found the mystery, now I will share some of my experiences. The ssh service is not installed in Ubuntu by default. If you connect to Ubuntu through ssh, You need to manually install openss

Why Install SSH? After Hadoop is started, namenode starts and stops various daemon on each node through SSH (Secure Shell. As a cainiao, the first time I used Hadoop, the installation and configuration was a bit complicated. When I went to Ubuntu to configure SSH, there was a problem. After thinking about it, I found the mystery, now I will share some of my experiences.

By default, the ssh service is not installed in Ubuntu. If you connect to Ubuntu through ssh, You need to manually install openssh-server. To determine whether to install the ssh service, run the following command:

Ssh localhost

The result is as follows:

The problem is analyzed as follows: openssh-server is not installed in Ubuntu by default. We can use a command to check that openssh-server is not installed if only the agent is installed. The command is as follows:

Ps-e | grep ssh

The effect is as follows:

Now that the problem is found, run the following command to install openssh-server:

Sudo apt-get install openssh-server

After the installation is complete, run the ps-e | grep ssh command to check whether openssh-server is installed. After entering the command, the following message is displayed, indicating that the installation is complete. In the figure, sshd is the one we installed.

Ps-e | grep ssh

Finally, we can see through the ssh localhost command that this command is mainly used to connect to the local machine. If you need to enter a password, it indicates that it is successful.

Ssh localhost

Approach to improving the SSH login authentication speed for Ubuntu http://www.linuxidc.com/Linux/2014-09/106810.htm

Enable SSH service for Android phones to remotely access Ubuntu 14.04 http://www.linuxidc.com/Linux/2014-09/106809.htm

How to add a dual authentication http://www.linuxidc.com/Linux/2014-08/105998.htm for SSH in Linux

Configure the SFTP environment http://www.linuxidc.com/Linux/2014-08/105865.htm for non-SSH users in Linux

Http://www.linuxidc.com/Linux/2014-06/103627.htm for configuring and managing SSH services on Linux

SSH getting started basic learning tutorials http://www.linuxidc.com/Linux/2014-06/103008.htm

For more information about Ubuntu, see Ubuntu special page http://www.linuxidc.com/topicnews.aspx? Tid = 2

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2015-01/112045.htm

Related Article

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.