SSH Startup failure resolution

Source: Internet
Author: User
Tags chmod ssh vps

VPS is 3 people share rental, do not know who operated what led to SSH failed to start, has been connected to the beginning of the system is not a bad, the back through the VPS terminal Landing to find SSH service is not running, so try to run sshd found the following error:

Starting sshd:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@ warning:unprotected PRIVATE KEY file! @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Permissions 0777 for '/etc/ssh/ssh_host_rsa_key ' are too open.

It is recommended this your private key files are not accessible by others.

This private key would be ignored.

Bad Permissions:ignore key:/etc/ssh/ssh_host_rsa_key

Could not load host key:/etc/ssh/ssh_host_rsa_key

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@ warning:unprotected PRIVATE KEY file! @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

Permissions 0777 for '/etc/ssh/ssh_host_dsa_key ' are too open.

It is recommended this your private key files are not accessible by others.

This private key would be ignored.

Bad Permissions:ignore key:/etc/ssh/ssh_host_dsa_key

Could not load host key:/etc/ssh/ssh_host_dsa_key

Disabling Protocol version 2. Could not load host key

Sshd:no Hostkeys available-exiting.

[FAILED]

Workaround:

#chmod sshd_config Ssh_host_dsa_key Ssh_host_key Ssh_host_rsa_key

#chmod 620 moduli

#chmod 644 Ssh_config ssh_host_dsa_key.pub ssh_host_key.pub ssh_host_rsa_key.pub

#service sshd Start

The following error occurred again:

[Root@bailongjun ssh]# Service sshd restart

stopping sshd: [FAILED]

Starting sshd:/var/empty/sshd must is owned by root and not group or world-writable.

[FAILED]

Login directly on the terminal, the problem appears as follows:

/var/empty/sshd must is owned by root and not group or world-writable.

Problem:

SSH on Linux failed to start

Report/var/empty/sshd must is owned by root and not group or world-writable.

Solution:

First through the physical terminal into Linux, Manual Check ssh found not running

-bash-2.05b#/etc/init.d/sshd Status

SSHD is stopped

The service was manually started and the report permissions error was found.

-bash-2.05b#/etc/init.d/sshd Start

Starting SSHD:/VAR/EMPTY/SSHD must is owned by root and not group or world-writable.

[FAILED]

-bash-2.05b#

Using the Rpm-v command, you can check that the software package for SSH is normal, but a directory is a master error.

-bash-2.05b# rpm-v Openssh-server

S.5 ..... C/etc/ssh/sshd_config

..... U../var/empty/sshd

-bash-2.05b#

After viewing the owner of this directory is not root, so start the SSH error

-bash-2.05b# ls-ld/var/empty/sshd/

D–x–x–x 2 vu00106 root 1024 Feb 2 2005/var/empty/sshd/

-bash-2.05b#

Change to root owner, start successful

-bash-2.05b# Chown root/var/empty/sshd/

-bash-2.05b#/etc/init.d/sshd Start

Starting sshd: [OK]

-bash-2.05b#

Fix this problem.

Alternatively, you can try:

This is a matter of authority.

The following two steps can be taken to resolve

Chown-r root.root/var/empty/sshd

chmod 744/var/empty/sshd

Service sshd Restart

Can solve the above problems.

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.