Unprotected private key file error

Hi,

I have mistakenly changed the permissions of the /etc folder, which generates the following error:

Jan 25 00:07:33 sshd[2321285]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Jan 25 00:07:33 sshd[2321285]: @         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
Jan 25 00:07:33 sshd[2321285]: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Jan 25 00:07:33 sshd[2321285]: Permissions 0660 for '/etc/ssh/ssh_host_ecdsa_key' are too open.
Jan 25 00:07:33 sshd[2321285]: It is required that your private key files are NOT accessible by others.
Jan 25 00:07:33 sshd[2321285]: This private key will be ignored.
Jan 25 00:07:33 sshd[2321285]: Unable to load host key "/etc/ssh/ssh_host_ecdsa_key": bad permissions
Jan 25 00:07:33 sshd[2321285]: Unable to load host key: /etc/ssh/ssh_host_ecdsa_key

and prevents me from connecting in SSH, I can’t even activate it.

I use a VPS server, without SSH connection possible, I can’t remove the permissions, if I update Yunohost will the permissions be restored? Is there a solution?

Maybe, when this error is detected, from the interface having a button that will allow to reset the default permissions would be great.

Thanks for your help.

Hello everyone, I solved my problem, here is how I did it:

1 - I duplicated the github of the “custom web app” of Yunohost on my github : https://github.com/YunoHost-Apps/my_webapp_ynh

2- In scripts/install I added two command lines after ynh_abort_if_errors :

sudo chmod 600 /etc/ssh/ssh_host_ed25519_key
sudo chmod 600 /etc/ssh/ssh_host_ecdsa_key

3 - I Installed the app on the Yunohost platform and… Problem solved! I could reactivate the connection via SSH.

For other beginners like me, be very careful about the authorization command in the /etc folder and generally everywhere. :')

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.