SCP文件从亚马逊的Linux机器虚框亚马逊、机器、文件、SCP

2023-09-11 09:48:33 作者:青春是ー首不眠的歌╰つ

我想从我的亚马逊Linux机器上的一个目录复制到我的虚拟盒。我写了下面的命令从我的亚马逊的Linux机器:

  SCP /家庭/用户/测试XYZ @ XYZ-VirtuaBox:/ home / user中
 

但我得到的错误信息:

  

无法解析主机名XYZ-VirtualBox的:姓名或服务未找到。   我不知道这是怎么回事。我的虚拟机的主机名是正确的。

解决方案

没有!虚拟机主机名不从Amazon Linux机器解析。你应该这样做倒过来。从虚拟机:

  SCP XYZ @亚马逊:/ home / user中/测试/ home / user的
 
亚马逊推出打包订单机器人 替换人类员工提升利润

或者另一种方式是建立的远程端口转发的,这样你就可以从你的亚马逊机器连接到你的虚拟框,但它取决于如果使用腻子或正常的ssh。但是,一般的命令是这样的:

  [本地] $的ssh -R 2222:XYZ-VirtuaBox:22亚马逊
[亚马逊] $ SCP-P 2222 /家庭/用户/测试XYZ @本地:/ home / user中
 

I am trying copy a directory from my amazon Linux machine to my virtual-box. I write the following command from my amazon Linux machine:

scp /home/user/test xyz@xyz-VirtuaBox:/home/user

but I get the error message:

Could not resolve hostname xyz-virtualbox: Name or service not found. I am not sure what's going on. My virtual machine hostname is right.

解决方案

No! Your virtual machine hostname is not resolvable from amazon linux machine. You should do this the other way round. From virtual machine:

scp xyz@amazon:/home/user/test /home/user

Or the other way is to set up remote port forwarding, so you will be able to connect from your Amazon machine to your virtual box, but it depends if you use Putty or normal ssh. But the general command can look like this:

[local] $ ssh -R 2222:xyz-VirtuaBox:22 amazon
[amazon]$ scp -P 2222 /home/user/test xyz@localhost:/home/user