Thank you for supporting the Cloud Customer Connect Community in 2024. It's a gift to work with you!

Look back
You're almost there! Please answer a few more questions for access to the Applications content. Complete registration
Interested in joining? Complete your registration by providing Areas of Interest here. Register

OCI: "sshd.service" fails to start on boot

edited Oct 23, 2023 2:47AM in Linux 1 comment

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]:

Howdy, Stranger!

Log In

To view full details, sign in.

Register

Don't have an account? Click here to get started!