Error message "WARNING: UNPROTECTED PRIVATE KEY FILE!" was printed while connecting through SSH.

Solution Verified - Updated -

Issue

  • Can not start sshd service
  • Error while connecting through SSH (Putty or Winscp), following errors can be seen in /var/log/messages:
Sep 15 16:25:40 hostname sshd[17397]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Sep 15 16:25:40 hostname sshd[17397]: error: @ WARNING: UNPROTECTED PRIVATE KEY FILE!  @
Sep 15 16:25:40 hostname sshd[17397]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Sep 15 16:25:40 hostname sshd[17397]: error: Permissions 0777 for '/etc/ssh/ssh_host_dsa_key' are too open.
Sep 15 16:25:40 hostname sshd[17397]: error: It is recommended that your private key files are NOT accessible by others.
Sep 15 16:25:40 hostname sshd[17397]: error: This private key will be ignored.
Sep 15 16:25:40 hostname sshd[17397]: error: bad permissions: ignore key: /etc/ssh/ssh_host_dsa_key
Sep 15 16:25:40 hostname sshd[17397]: error: Could not load host key: /etc/ssh/ssh_host_dsa_key
Sep 15 16:25:40 hostname sshd[17397]: Disabling protocol version 2. Could not load host key
Sep 15 16:25:40 hostname sshd[17397]: sshd: no hostkeys available -- exiting.
Aug  7 08:02:15 hostname sshd[30600]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Aug  7 08:02:15 hostname sshd[30600]: error: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @   
Aug  7 08:02:15 hostname sshd[30600]: error: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Aug  7 08:02:15 hostname sshd[30600]: error: Permissions 0711 for '/etc/ssh/ssh_host_rsa_key' are too open.
Aug  7 08:02:15 hostname sshd[30600]: error: It is recommended that your private key files are NOT accessible by others.
Aug  7 08:02:15 hostname sshd[30600]: error: This private key will be ignored.
Aug  7 08:02:15 hostname sshd[30600]: error: bad permissions: ignore key: /etc/ssh/ssh_host_rsa_key
Aug  7 08:02:16 hostname sshd[30600]: error: Could not load host key: /etc/ssh/ssh_host_rsa_key
Aug  7 08:02:16 hostname sshd[30600]: Disabling protocol version 1. Could not load host key 

Environment

  • Red Hat Enterprise Linux 4
  • Red Hat Enterprise Linux 5
  • Red Hat Enterprise Linux 6
  • Red Hat Enterprise Linux 7
  • Red Hat Enterprise Linux 8
  • openssh

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content