Copy Files between ESXi Hosts by using SCP (Secure Copy) Command / SCP Copy Stalled Fix

scp allows files to be copied to, from, or between different hosts. It uses ssh for data transfer and provides the same authentication and same level of security as ssh.

Enable SSH on ESXi Hosts

First make sure the Port 22 is open between source and destination ESXi host . If its not, the you can fix it using below steps:

On source and destination ESXi hosts make sure TSM-SSH Service is in Running State.

Make sure SSH Client in ESXi Networking Firewall rules is Enabled on both source and destination ESXi hosts in Networking -> Firewall rules -> SSH Client. Click on Actions and then Enable.

Test Port 22

Connect to Source ESXi Host using Putty. Open Putty -> Type the IP Address of ESXi Host and connect on port 22 to open the shell. Login using root or admin account.

nc -z <destination esxi host ip> <destination port number>. For example if the destination ESXi host is then use command nc -z 22 to check if port 22 is opened. You should see a succeeded ! message if the port is opened.

Copy files between two Esxi hosts using SCP Command

scp <source file or folder path> [email protected]<destination esxi hostname or IP>:<destination folder path>


scp /vmfs/volumes/datastore1/server1/* [email protected]:/vmfs/volumes/LocalDataStore/server1

If you get the message “rekeyed outbound cipher” “rekeyed inbound cipher” and copy process is getting stalled.

After you run the scp command to copy the data across to destination ESXi. If you get messages like “rekeyed outbound cipher” “rekeyed inbound cipher” and the copy process is breaking with stalled status, this could be issue with Bandwidth which needs to be throttled using -l switch of scp command.

Error after the operation stalls and it will keep on trying to copy the files but due to issues with the bandwidth, you will get rekeyed cipher message repeatedly. However, if you are ok with the messages then you can leave it running, it should copy the data despite the messages.

The workaround is to use the -l switch of the command and throttle the bandwidth. You can adjust the value of -l switch according to your environment. You can start with higher value and keep on throttling / lowering the value till you find its running successfully without any issues.

-l limit
Limits the used bandwidth, specified in Kbit/s.

1 MB/s = 8192 Kbit/s.

scp -l 8192 /vmfs/volumes/datastore1/server1/* [email protected]:/vmfs/volumes/LocalDataStore/server1

Inline Feedbacks
View all comments
Would love your thoughts, please comment.x