May 11, 20224 yr I have two servers one running 6.9.2 and my backup server is on 6.10-rc7. When attempting to connect from the backup server to my primary, I get the below error. When doing the inverse everything works correctly and no errors reported. I have tried deleting the .ssh folder from the flash/configs and recreating the connection but the problem persists. Also tried resetting permissions, still a no go. Any idea what causes this? It does seem to allow the connection I just don't like errors. Thanks in advance for any help. root@XXXXXX:~# ssh 10.10.1.2 Enter passphrase for key '/root/.ssh/id_ed25519': hostfile_replace_entries: link /root/.ssh/known_hosts to /root/.ssh/known_hosts.old: Operation not permitted update_known_hosts: hostfile_replace_entries failed for /root/.ssh/known_hosts: Operation not permitted Edited May 11, 20224 yr by xxnumbxx spelling
May 11, 20224 yr Community Expert I think I remember seeing the same thing when connecting from a server running an older release, but since it still worked didn't though much about it, it should go away once you update the backup server.
May 15, 20224 yr Community Expert Turns out this can also occur between two servers running v6.10-rc, so lets see if someone has an idea on what's causing this, or you can create a bug report.
May 15, 20224 yr In the interim it might be possible to bypass that if you are confident of no man in the middle attacks and bypass the host key check using: ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null Not sure if it will work in this exact scenario.
June 1, 20224 yr I have this same problem since updating to 6.10.2. I have two unraid servers both on 6.10.2 If I SSH in from one to the other I get the error "hostfile_replace_entries: link /root/.ssh/known_hosts to /root/.ssh/known_hosts.old: Operation not permitted update_known_hosts: hostfile_replace_entries failed for /root/.ssh/known_hosts: Operation not permitted". It does proceed to log me in though. I tried clearing the known host file and it did then update the file despite the message. The other oddity is it only does it in one direction. If I SSH in form the other server it works fine. I can see no difference between the file permissions. The only other difference I can think of is that on one server I updated regularly through the 6.10 beta releases and on the other I went from 6.9 straigh to the stable release of 6,10. I see that this was reported with OpenSSH but it was patched some while ago
June 5, 20224 yr Hi, first Post and an than a solution if any one have this error like me: update_known_hosts: hostfile_replace_entries failed for /root/.ssh/known_hosts: Operation not permitted I found this work for me: ssh-keyscan -H TARGET_HOST >> ~/.ssh/known_hosts on both systems and the error is gone.
June 5, 20224 yr Community Expert 27 minutes ago, zer0.de said: I found this work for me: Thanks, also worked for me.
July 5, 20224 yr On 6/5/2022 at 4:37 AM, zer0.de said: Hi, first Post and an than a solution if any one have this error like me: update_known_hosts: hostfile_replace_entries failed for /root/.ssh/known_hosts: Operation not permitted I found this work for me: ssh-keyscan -H TARGET_HOST >> ~/.ssh/known_hosts on both systems and the error is gone. I was having this error when SSH'ing into a non-unraid box too. This `ssh-keyscan` command also resolved the issue for me. Thanks!
July 20, 20223 yr On 6/5/2022 at 12:37 PM, zer0.de said: ssh-keyscan -H TARGET_HOST >> ~/.ssh/known_hosts Worked for me too 6.10.3 so thank you.
January 9, 20233 yr On 6/5/2022 at 4:37 AM, zer0.de said: I found this work for me: ssh-keyscan -H TARGET_HOST >> ~/.ssh/known_hosts on both systems and the error is gone. Thank you! this worked for me too.
January 9, 20233 yr I'm SSHing to a remote Raspian OS server over Wireguard. I'm getting theses same errors when Rsync'ing to the remote server. Do I need to replace any of the command test? I tried this command replacing the TARGET_HOST part with the SSH address of my other server. i.e. [email protected] but I get this output in unRAID's CLI: getaddrinfo [email protected]: Name or service not known getaddrinfo [email protected]: Name or service not known getaddrinfo [email protected]: Name or service not known getaddrinfo [email protected]: Name or service not known getaddrinfo [email protected]: Name or service not known Any ideas? Edited January 9, 20233 yr by adminmat
January 9, 20233 yr Community Expert 6 hours ago, adminmat said: Any ideas? Use only the target IP address.
January 9, 20233 yr Ok I had to first delete the contents from the /root/.ssh/known_keyhosts file. Then after running the command above I'm no longer getting the errors. Thanks.
April 11, 20242 yr Still helping to this date with the fix! On 6/5/2022 at 9:37 PM, zer0.de said: Hi, first Post and an than a solution if any one have this error like me: update_known_hosts: hostfile_replace_entries failed for /root/.ssh/known_hosts: Operation not permitted I found this work for me: ssh-keyscan -H TARGET_HOST >> ~/.ssh/known_hosts on both systems and the error is gone. Still helping to this day. Thanks!
September 19, 20241 yr Hi, i also have this error. I run the ssh-keygen on the firs server without problems. But my second server has not the standard port. I tried ssh-keyscan -H 192.168.2.120:2001 >> ~/.ssh/known_hosts but this doesn´t work. How can i run ssh-keyscan with a server on an other port? Thanks!
October 13, 20241 yr In my case, the command also didn't solve the issue. A look into the known_hosts file revealed that the IP (not the port) was written in square brackets. After I removed those, it worked.
October 26, 20241 yr I lost an hour before I found the best solution. Here is the full version of this command that also works for ssh servers running on a port other than 22 and for messages like: getaddrinfo user@address: Name or service not known ssh-keyscan -H -p SSH_PORT TARGET_HOST >> ~/.ssh/known_hosts Edited February 15, 20251 yr by jaclas correct command syntax
November 3, 20241 yr If anyone is interested in why this error happens in the first place, it's because (I believe) the file system on /boot is vfat. The ssh command wants to update the known_hosts file and it tries to make a backup copy of known_hosts using the link command ln. But it's trying to make a hard link, and hard links aren't supported on vfat file systems. So the operation isn't permitted. By running the ssh-keyscan and adding its output to known_hosts, ssh is happy with the content of known_hosts and doesn't need to update it, so the error is avoided.
November 14, 20241 yr On 11/3/2024 at 11:22 AM, MrChip said: If anyone is interested in why this error happens in the first place, it's because (I believe) the file system on /boot is vfat. The ssh command wants to update the known_hosts file and it tries to make a backup copy of known_hosts using the link command ln. But it's trying to make a hard link, and hard links aren't supported on vfat file systems. So the operation isn't permitted. By running the ssh-keyscan and adding its output to known_hosts, ssh is happy with the content of known_hosts and doesn't need to update it, so the error is avoided. I try and run that command, and it seems to go through but then i immediately run a ssh ****@*****.rsync.net ls and I get : ssh: connect to host *******.rsync.net port 22: Network is unreachable Then after a short time I'm able to send commands again but I still get: hostfile_replace_entries: link /root/.ssh/known_hosts to /root/.ssh/known_hosts.old: Operation not permitted update_known_hosts: hostfile_replace_entries failed for /root/.ssh/known_hosts: Operation not permitted Now everything does seem to work but those errors persist. I've done the same thing to the same server from my windows machine without issue. But this remains on my unraid server.
November 20, 20241 yr How would this work if the target is a Windows Computer that is not running sshd? I'm using Filezilla on Windows to connect.
August 12, 2025Aug 12 On 10/26/2024 at 10:46 AM, jaclas said:I lost an hour before I found the best solution. Here is the full version of this command that also works for ssh servers running on a port other than 22 and for messages like: getaddrinfo user@address: Name or service not known ssh-keyscan -H -p SSH_PORT TARGET_HOST >> ~/.ssh/known_hosts you are my hero, thank you! Edited August 12, 2025Aug 12 by bruise_lee
November 14, 2025Nov 14 Community Expert Had this error too: hostfile_replace_entries: link /root/.ssh/known_hosts to /root/.ssh/known_hosts.old: Operation not permittedTried all above. No go. However, can login with password or by using ssh -i ~/.ssh/id_ed25519 root@ipaddress Any help appreciated
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.