OCI: "sshd.service" fails to start on boot
Oracle Cloud Infrastructure - Version N/A and later
Linux x86-64
Symptoms
The sshd.service fails to start on boot, the following message is seen on the console during the boot process:
Failed to start OpenSSH server daemon. See 'systemctl status sshd.service' for details.
Cause
Incorrect ownership(opc opc) of the private host keys files.
# cd /etc/ssh # ls -l *host*_key -rw-r-----. 1 opc opc 227 Sep 6 08:16 ssh_host_ecdsa_key -rw-r-----. 1 opc opc 387 Sep 6 08:16 ssh_host_ed25519_key -rw-r-----. 1 opc opc 1679 Sep 6 08:16 ssh_host_rsa_key # journalctl -u sshd Oct 12 09:47:02 hostname sshd[23241]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@ Oct 12 09:47:02 hostname sshd[23241]: @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ Oct 12 09:47:02 hostname sshd[23241]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@ Oct 12 09:47:02 hostname sshd[23241]: Permissions 0640 for '/etc/ssh/ssh_host_rsa_key' are too open. Oct 12 09:47:02 hostname sshd[23241]: It is required that your private key files are NOT accessible by others. Oct 12 09:47:02 hostname sshd[23241]: This private key will be ignored. Oct 12 09:47:02 hostname sshd[23241]: key_load_private: bad permissions Oct 12 09:47:02 hostname sshd[23241]: Could not load host key: /etc/ssh/ssh_host_rsa_key Oct 12 09:47:02 hostname sshd[23241]:
Tagged:
0