【发布时间】:2021-04-12 10:36:00
【问题描述】:
我创建了一个 EC2 实例并尝试在其上启动一个烧瓶 api(带有 tensorflow)。
我目前正在尝试将文件从我的 Mac 传输到 EC2 实例,但不断收到以下错误...
Connection closed by 100.26.246.133 port 22
lost connection
我使用的scp命令如下。
scp -i /Users/joelleo/Desktop/Work/ICC:Computing/Projects:Events/SCSE/2021/others/ec2-no-restrictions.pem -r /Users/joelleo/Desktop/Work/ICC:Computing/Projects:Events/SCSE/2021/application/ ec2-100-26-246-133.compute-1.amazonaws.com:~/app/
我已经仔细检查了所有文件路径,它是正确的。我也成功地通过 ssh 进入了 ec2 实例,并且在过去也成功地使用了 scp
ssh 进入 ec2 实例..
(base) joelleo@Joels-MacBook-Air others % ssh -i "ec2-no-restrictions.pem" ubuntu@ec2-100-26-246-133.compute-1.amazonaws.com
Welcome to Ubuntu 18.04.5 LTS (GNU/Linux 5.4.0-1029-aws x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
System information as of Wed Jan 6 16:44:00 UTC 2021
System load: 0.0 Processes: 112
Usage of /: 23.8% of 7.69GB Users logged in: 0
Memory usage: 1% IP address for eth0: 172.31.54.61
Swap usage: 0%
51 packages can be updated.
33 updates are security updates.
New release '20.04.1 LTS' available.
Run 'do-release-upgrade' to upgrade to it.
*** System restart required ***
Last login: Wed Jan 6 16:23:51 2021 from 115.66.136.180
ubuntu@ip-172-31-54-61:~$
我还检查了我在 ec2 实例中打开了正确的端口。
我在网上看到scp 使用ssh 工作。有人可以帮忙解释为什么我现在无法使用 scp 连接吗?
谢谢!
【问题讨论】:
-
scp命令make me uncomfy 中文件路径中的那些冒号。不过,这看起来像是某种连接问题。您可以尝试使用scp和-v标志以获得更详细的输出,这可能会提供更多线索。 -
另外,你的SCP命令有问题,如果你替换
:(colon) with _(underscore)你的命令应该是这样的scp -i /Users/joelleo/Desktop/Work/ICC_Computing/Projects_Events/SCSE/2021/others/ec2-no-restrictions.pem -r /Users/joelleo/Desktop/Work/ICC_Computing/Projects_Events/SCSE/2021/application/ ubuntu@ec2-100-26-246-133.compute-1.amazonaws.com:~/app/解释scp -i <.pem_file_location> -r <source_folder> <remote_host_user>:<remote_host_ip> -
嘿,@Red 你的问题解决了吗?
标签: amazon-web-services amazon-ec2 scp