Ssh: connect to host xxx. xxx port 22: Connection refused (take Ubuntu12.04 as an example)

Source: Internet
Author: User

When using ssh, the following error occurs: connect to host xxx. xxx port 22: Connection refused.

The cause of this error is that the ssh-server is not started or not installed (Ubuntu12.04 only openssh-client is installed by default, and openssh-server is not installed ).

1. Check whether openssh-sever is enabled.

Run the following command:

Ps-e | grep sshd

If no sshd process exists, run the following command:

Sudo/etc/init. d/ssh start


2. Install openss-server

If ssh does not exist, openssh-server is not installed. Run the following command to install openssh-server.

Sudo apt-get install openssh-server

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.