Can't open '/etc/ssh/ssh_host_rsa_key.pub' - No such file or directory (500)

impeding8615

New Member
Aug 27, 2022
7
0
1
Hi,

after logging in, I get the following error message:
can't open '/etc/ssh/ssh_host_rsa_key.pub' - No such file or directory (500)

And indeed, the file doesn't exist. It doesn't exist because I deleted it intentionally.
I generated the keys with a different file name.

in /etc/ssh/sshd_config the HostKey options are commented out.
In my custom SSH config /etc/ssh/sshd_config.d/local.conf I've set the correct file names.
SSH works perfectly fine, as expected.

Does Proxmox use the ssh host keys for something else and has file paths hardcoded instead of fetching it from sshd_config?
Or where does this message come from? I couldn't find error messages in any pve logs either...
 
I am actually searching the .ssh directory, are you saying its equivalent is in /etc/ssh ?
"/etc/ssh" stores the ssh client/server configs. If you want to setup RSA keys for your root user have a look at "/root/.ssh" and for others users at "/home/SomeUserName/.ssh". Files with a "." infront of it are hidden, so you need to use commands like ls -la /root to also show hidden files/folders. ls /root won't show them.
 
"/etc/ssh" stores the ssh client/server configs. If you want to setup RSA keys for your root user have a look at "/root/.ssh" and for others users at "/home/SomeUserName/.ssh". Files with a "." infront of it are hidden, so you need to use commands like ls -la /root to also show hidden files/folders. ls /root won't show them.
Thanks, is it possible to permit only the public key connections on port 22?
 
Thanks, is it possible to permit only the public key connections on port 22?
Yes, edit "/etc/ssh/sshd_config" and change the line to PasswordAuthentication no. Then login with passwords won't work anymore and only RSA key logins are allowed.
 
Last edited:
Nobody knows how to fix this, other than using the default file names?
Did you manage to fix it? I have the same problem because I do not use RSA keys anymore and deleted them intentionally. For me it seems that proxmox uses those keys in any kind to connect locally via ssh e.g. for web shell access or the metrics.
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!