How to Copy files between ESXi hosts using SCP Command

简介:

How to Copy files between ESXi hosts using SCP command

Enable SSH and allow SSH in ESXi firewall

Only prerequisite to copy files between ESXi host using SCP command is that both source and destination ESXi host should have SSH enabled and SSH allowed in Firewall. Let’s take a look at how to enable SSH and allow SSH via firewall in the standalone ESXi host. In this example, We are going to transfer files between ESXi 6.5 hosts using SCP command.

Log in to the ESXi Host Client using the below URL https:<ESXi host name or IP>/ui and log in with “root” credentials.

Click on Manage under Host -> Services -> Select the SSH service “TSM-SSH” –> Click on Start to start the SSH service.

Copy Files between ESXi hosts using SCP

Once SSH service is started, We need to allow the SSH Client in ESXi firewall. To allow SSH client in ESXi Firewall, Click on Networking -> Firewall -> Select SSH Client -> Click on “Enable” under Actions Menu.

Copy Files between ESXi hosts using SCP

Testing SSH Port Connectivity between ESXi hosts

Once SSH service is started and allowed via ESXi firewall on both source and destination ESXi, You can test the connectivity on Port 22 between the ESXi hosts using the below command

nc -Z destination_hostname port number Example: nc -Z esxi65-2 22

1

2

3

4

5

nc -Z destination_hostname port number

 

Example:

 

nc -Z esxi65-2 22

Connection to destination ESXi host via port 22 is succeeded. We are good to copy files between ESXi host using SCP command.

Copy Files between ESXi hosts using SCP


Copy Files between ESXi hosts using SCP command

You can use the SCP command in below format to copy files between ESXi host.

SCP /source_directory  root@destinatiion_hostname://destination_dircetory/

1

SCP /source_directory  root@destinatiion_hostname://destination_dircetory/

I have transferred windows 2008 OS ISO image file called “win_2k8.iso” store in the directory called “ISO” in local datastore  of the source ESXi host “esxi65-1” to the “ISO” directory in Local datatsore of destination ESXi host “esxi65-2” using the below command

SCP /vmfs/volumes/datastore1/ISO/win_2k8.iso  root@esxi65-2:/vmfs/volumes/datastore1/ISO

1

SCP /vmfs/volumes/datastore1/ISO/win_2k8.iso  root@esxi65-2:/vmfs/volumes/datastore1/ISO

It will prompt you to enter the root password of the destination ESXi host to transfer files using SCP. Enter the password and Hit enter. The copy will start and It will display the progress of the copy in % and also the Speed of the transfer and ETA to complete the transfer.

Copy Files between ESXi hosts using SCP

Copy of files between the ESXi host is completed and It shows Size of the file, Average speed of the transfer and time taken to complete the copy.

Copy Files between ESXi hosts using SCP

I have connected to destination ESXi host “esxi65-2” to validate the copied file. It is located under ISO directory of local datastore.

Copy Files between ESXi hosts using SCP

That’s it. We are done and I am sure you are clear with the procedure to copy files between ESXi host using SCP command. Thanks for Reading !!!. Be social and share it with social media, if you feel worth sharing it.

本文转自学海无涯博客51CTO博客,原文链接http://blog.51cto.com/549687/1967726如需转载请自行联系原作者


520feng2007

相关文章
|
2月前
|
Linux 开发工具 数据安全/隐私保护
CentOS7报错:“xxx is not in the sudoers file. This incident will be reported“解决方法
CentOS7报错:“xxx is not in the sudoers file. This incident will be reported“解决方法
|
网络安全
无法启动ssh:/run/sshd must be owned by root and not group or world-writable.
无法启动ssh:/run/sshd must be owned by root and not group or world-writable.
366 0
无法启动ssh:/run/sshd must be owned by root and not group or world-writable.
|
网络安全 开发工具 git
错误解决办法:exec /usr/lib/ssh/ssh-askpass : No such file or directory error.
错误解决办法:exec /usr/lib/ssh/ssh-askpass : No such file or directory error.
286 0
CentOS cp 复制隐藏文件提示 cp: cannot stat ?.xxx*?. No such file or directory
执行的命令与错误信息: # cp -a /etc/skel/* /home/postgrescp: cannot stat ?.etc/skel/*?. No such file or directory 使用cp复制普通文件时,可以使用 * 号通配符,而在复制隐藏文件时,需要使用.
4627 0
|
网络安全 开发工具
|
网络安全 开发工具
|
数据安全/隐私保护
Linux_服务器_03_xxx is not in the sudoers file.This incident will be reported.的解决方法
1.切换到root用户下,怎么切换就不用说了吧,不会的自己百度去.2.添加sudo文件的写权限,命令是:chmod u+w /etc/sudoers3.编辑sudoers文件vi /etc/sudoers找到这行 root ALL=(ALL) ALL,在他下面添加xxx ALL=(ALL) ALL ...
951 0
下一篇
无影云桌面