Centos7 cannot use ssh Login and Solution

Source: Internet
Author: User

Centos7 cannot use ssh Login and Solution

Centos7 cannot use ssh Login and Solution

Today, the project team reported that a Centos7 server could not log on via SSH, so after logging on to the system locally, I found that the SSH service was not started, this method mainly uses the netstat-anlpt | grep 22 Method for viewing;

Speaking of this, if it is Centos7, if we want to use the netstat command, we need to install net-tools before using it.

Yuminstatllnet-tools-y ---- install netstat Tools

Failed to start sshd service manually. error message (port 22 is not listened)

There is no independent log for ssh in Centos7, so in message

Tail–f /var/log/message /usr/sbin/ The sshd file is missing.

Cd /usr/sbin/ Does not display the sshd file or directory

So we need to reinstall it.

yumreinstallopenssh-server

Installation Complete

After installation, the file contains ssh file information.

Restart the sshd file.

Systemctlstartsshd --- start the sshd service

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.