如何在ec2上运行scp

问题描述 投票:0回答:1

我正在尝试通过在ec2上运行scp命令将文件从服务器复制到服务器。

**My command:**
[ec2-user@ip-xx-xx-xx-xxx ~]$ scp -P 51865 [email protected]:/home/yakir/tr/tracker-2019-12-12.tar.gz [email protected]:/home/ec2-user/tracker-2019-12-12.tar.gz

错误是:

usage: scp [-12346BCpqrv] [-c cipher] [-F ssh_config] [-i identity_file]
           [-l limit] [-o ssh_option] [-P port] [-S program]
           [[user@]host1:]file1 ... [[user@]host2:]file2

我应该怎么做才能使其起作用?

谢谢!

bash shell command-line scp
1个回答
0
投票

ssh到服务器并运行scp

ssh -P 51865 [email protected] "scp /home/yakir/tr/tracker-2019-12-12.tar.gz [email protected]:/home/ec2-user/tracker-2019-12-12.tar.gz"
© www.soinside.com 2019 - 2024. All rights reserved.