Skip to content

Instantly share code, notes, and snippets.

@yano3nora
Last active March 27, 2025 04:44
Show Gist options
  • Select an option

  • Save yano3nora/c9af19ae9dbbfd7b21aacf787228ee23 to your computer and use it in GitHub Desktop.

Select an option

Save yano3nora/c9af19ae9dbbfd7b21aacf787228ee23 to your computer and use it in GitHub Desktop.
scp - file transfer (download) command by ssh

https://qiita.com/katsukii/items/225cd3de6d3d06a9abcb

# CREDENTIAL.pem 鍵で ec2-user ユーザで xxx ホスト (ec2) に ssh login して
# ~/path/to/src ファイルをローカルの ~/path/to/dist に落としてくる
$ scp -i "CREDENTIAL.pem" -r ec2-user@xxx.ap-northeast-1.compute.amazonaws.com:~/path/to/src ~/path/to/dist

# local の ~/path/to/src を ec2 の ~/path/to/dist へ
$ scp -i "CREDENTIAL.pem" -r ~/path/to/src ec2-user@xxxx.ap-northeast-1.compute.amazonaws.com:~/path/to/dist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment