Read from socket failed: Connection reset by peer

Source: Internet
Author: User
Tags connection reset

Generally, when using SSH in Linux, if this error occurs, we recommend that you first check the log.

The SSH logs of ubuntu are stored in/var/log/auth. log.

Log errors are similar to the following:

Dec 22 09:43:31 x079-liongao sshd[14883]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Dec 22 09:43:31 x079-liongao sshd[14883]: error: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @Dec 22 09:43:31 x079-liongao sshd[14883]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Dec 22 09:43:31 x079-liongao sshd[14883]: error: Permissions 0777 for '/etc/ssh/ssh_host_dsa_key' are too open.Dec 22 09:43:31 x079-liongao sshd[14883]: error: It is recommended that your private key files are NOT accessible by others.Dec 22 09:43:31 x079-liongao sshd[14883]: error: This private key will be ignored.Dec 22 09:43:31 x079-liongao sshd[14883]: error: bad permissions: ignore key: /etc/ssh/ssh_host_dsa_keyDec 22 09:43:31 x079-liongao sshd[14883]: error: Could not load host key: /etc/ssh/ssh_host_dsa_keyDec 22 09:43:35 x079-liongao sudo:  liongao : TTY=pts/3 ; PWD=/home/liongao ; USER=root ; COMMAND=/usr/bin/ssh localhostDec 22 09:43:35 x079-liongao sshd[14892]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Dec 22 09:43:35 x079-liongao sshd[14892]: error: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @Dec 22 09:43:35 x079-liongao sshd[14892]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Dec 22 09:43:35 x079-liongao sshd[14892]: error: Permissions 0777 for '/etc/ssh/ssh_host_rsa_key' are too open.Dec 22 09:43:35 x079-liongao sshd[14892]: error: It is recommended that your private key files are NOT accessible by others.Dec 22 09:43:35 x079-liongao sshd[14892]: error: This private key will be ignored.Dec 22 09:43:35 x079-liongao sshd[14892]: error: bad permissions: ignore key: /etc/ssh/ssh_host_rsa_keyDec 22 09:43:35 x079-liongao sshd[14892]: error: Could not load host key: /etc/ssh/ssh_host_rsa_keyDec 22 09:43:35 x079-liongao sshd[14892]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Dec 22 09:43:35 x079-liongao sshd[14892]: error: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @Dec 22 09:43:35 x079-liongao sshd[14892]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@Dec 22 09:43:35 x079-liongao sshd[14892]: error: Permissions 0777 for '/etc/ssh/ssh_host_dsa_key' are too open.Dec 22 09:43:35 x079-liongao sshd[14892]: error: It is recommended that your private key files are NOT accessible by others.Dec 22 09:43:35 x079-liongao sshd[14892]: error: This private key will be ignored.Dec 22 09:43:35 x079-liongao sshd[14892]: error: bad permissions: ignore key: /etc/ssh/ssh_host_dsa_keyDec 22 09:43:35 x079-liongao sshd[14892]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key

Obviously, it is about permissions. You only need to correct all the files in the/etc/ssh directory to the correct permissions. If you do not know how much to change to, you can check the directory permissions after successful installation of SSH by default. You 'd better uninstall SSH and reinstall it again.

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.