VMware Cloud Community
jravnsbaek
Contributor
Contributor

copy files from one esxi to another

When I try to copy files from one esxi host to another it gives error:

[root@esxi01:~]scp /var/log/init.log root@esxi02.mydomain.com:/tmp

hostfile_replace_entries: link /.ssh/known_hosts to /.ssh/known_hosts.old: Function not implemented
update_known_hosts: hostfile_replace_entries failed for /.ssh/known_hosts: Function not implemented

 

Even when I ssh from esxi01 to esxi02 I get the same error but the ssh connection is successfull:

[root@esxi01:/tmp] ssh root@esxi02.mydomain.com

(root@esxi02.mydomain.com) Password:
hostfile_replace_entries: link /.ssh/known_hosts to /.ssh/known_hosts.old: Function not implemented
update_known_hosts: hostfile_replace_entries failed for /.ssh/known_hosts: Function not implemented

[root@esxi02:~]

I have disabled the firewall on the hosts while testing, but are still unable to scp between the hosts.

Reply
0 Kudos
2 Replies
peetz
Leadership
Leadership

Try to add the parameters

-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null

to the scp command (as suggest e.g here: https://serverfault.com/questions/330503/scp-without-known-hosts-check

 

Twitter: @VFrontDe, @ESXiPatches | https://esxi-patches.v-front.de | https://vibsdepot.v-front.de
Reply
0 Kudos
haprinz
Contributor
Contributor

Hi

the issue is, that there is no '.ssh' directory in / on ESXi
the directory in esxi is placed to /etc/ssh/keys_<username>

same for 'authorized_keys' file, which is usually to find in this directory, in case you want to implement rsa key authentication.

it worked for me by creating a softlink (ln -s /etc/ssh/keys-root /.ssh)
the very first connection to anther host still produces the above message, but just simply because there was no known_hosts file at all at the time

after first connect you will see the known_hosts file then
and when connecting to the next host, you will not get the message anymore, as well you can verify the changed filesize and content of the known_hosts file.

for the point 'but are still unable to scp between the hosts'
pls check that again, scp should be very well possible, since you are obviously able to login to the other server.
usually there is (as u had mentioned) the firewall blocking outgoing requests from ssh-client
but if ssh-client outgoing is allowed, it doesn't matter anymore if ssh or scp is getting used..


Cheers

/s/Hans-Werner Prinz
Reply
0 Kudos