Linux SSH key failure

Source: Internet
Author: User

Handling/etc/ssh/ssh_host_rsa_key Failure issues
Handling/etc/ssh/ssh_host_rsa_key Failure issues
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ warning:unprotected PRIVATE KEY file! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0777 for '/etc/ssh/ssh_host_rsa_key ' is 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 ' is 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]

If a bug has occurred

1. Backup/etc/ssh/ssh_host_rsa_key
sudo cp/etc/ssh/ssh_host_rsa_key ~/etc/ssh/ssh_host_rsa_key

2. Backup/etc/ssh/ssh_host_dsa_key
sudo cp/etc/ssh/ssh_host_dsa_key ~/etc/ssh/ssh_host_dsa_key

3. Delete the original two configuration files
sudo rm-rf/etc/ssh/ssh_host_rsa_key; sudo rm-rf/etc/ssh/ssh_host_dsa_key

4. Restart the SSHD service
Sudo/etc/init.d/sshd restart

5. If the following error occurs, then configure the
stopping sshd: [FAILED]
Starting sshd:/var/empty/sshd must is owned by root and not group or world-writable.
[FAILED]

6. Authorizing configuration Files
chmod 744/var/empty/sshd
chmod u+rwx/var/empty/ssh/etc/local~
Note: If the owner of the/VAR/EMPTY/SSH/ETC has EXECUTE permission sshd also cannot start successfully, need to remove the permissions

7. Start the SSHD service again if this is the case

This is correct
stopping sshd:                                               [  ok ]
Starting sshd:                                                [  ok ]

If that's the case
stopping sshd: [FAILED]
Starting sshd: [OK]
Start again or this will be problematic and need to be configured again

8. View the listening state of the sshd process
Like what:
[Email protected] ~]# NETSTAT-NATPL | grep sshd
TCP 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 27641/sshd # #正确的显示方式
TCP 0 0 172.28.88.67:22 172.28.88.68:50692 established 19493/sshd # #需要kill
TCP 0 0 172.28.88.67:22 172.28.88.78:56349 established 25221/sshd # #需要kill
TCP 0 0 172.28.88.67:22 172.28.88.208:50812 established 20536/sshd # #需要kill
TCP 0 172.28.88.67:22 172.28.88.18:52873 established 27550/sshd # #需要kill
TCP 0 0::: $:::* LISTEN 27641/sshd # #正确的显示方式

9. It's not a problem to start again.

stopping sshd: [OK]
Starting sshd: [OK]

This article is from the "Night Cold" blog, please be sure to keep this source http://miaopan.blog.51cto.com/4233458/1559106

Linux SSH key failure

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.