Advertisement
Tritonio

Error `could not load host key` when trying to recreate SSH host keys

Mar 15th, 2021
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1.  
  2.  
  3. sudo ssh-keygen -f /etc/ssh/ssh_host_rsa_key -N 'myverylongpasswordhere' -b 4096 -t rsa
  4.  
  5. recreates me the keys. but, after restarting the server, i recieve
  6.  
  7. could not load host key: /etc/ssh/ssh_host_rsa_key
  8.  
  9. You create a hostkey with a password. Is there any customization to unlock that hostkey? If not, then I think that is what is to be expected: the script that manages the service starts up, tries to load the hostkey, and fails. As far as I know you shouldn't create hostkeys protected with passwords.
  10.  
  11. If you are interested in hardening your SSH server then I recommend reading https://stribika.github.io/2015/01/04/secure-secure-shell.html the command used to create the hostkey in that document is:
  12.  
  13. ssh-keygen -t rsa -b 4096 -f ssh_host_rsa_key
  14.  
  15. But you should read the entire document before making any changes.
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement