scp (secure copy) to ec2 instance without password

前端 未结 14 1826
野性不改
野性不改 2020-12-02 03:32

I have an EC2 instance running (FreeBSD 9 AMI ami-8cce3fe5), and I can ssh into it using my amazon-created key file without password prompt, no problem.

However, whe

相关标签:
14条回答
  • 2020-12-02 04:12
    scp -i /path/to/your/.pemkey -r /copy/from/path user@server:/copy/to/path
    
    0 讨论(0)
  • 2020-12-02 04:14

    copy a file from a local server to a remote server

    sudo scp -i my-pem-file.pem ./source/test.txt ec2-user@1.2.3.4:~/destination/
    

    copy a file from a remote server to a local machine

    sudo scp -i my-pem-file.pem ec2-user@1.2.3.4:~/source/of/remote/test.txt ./where/to/put
    

    So the basically syntax is:-

    scp -i my-pem-file.pem username@source:/location/to/file username@destination:/where/to/put
    

    -i is for the identity_file

    0 讨论(0)
提交回复
热议问题