0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

PuttyでEC2と直接ファイルをやり取りする

Last updated at Posted at 2021-08-09

はじめに

たまーに使おうとして忘れるコマンドの自分用メモです。AmazonLinuxインスタンスのEC2とファイルのやり取りをします。.ppkファイルが必要です。

参考サイト:
https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/putty.html

ダウンロード

pscp -i path/to/ppkfile.ppk ec2-user@<IPv4address>:/home/ec2-user/path/to/srcfile.txt ./dist/file.txt 

EC2の/home/ec2-user/path/to/にあるsrcfile.txt./dist//file.txtとして保存します。***このコマンドをたたくのはローカルからです。***よくsshで接続してEC2でたたいてできない!ってなります(自分だけ)。

アップロード

pscp -i path/to/ppkfile.ppk ./dist/file.txt ec2-user@<IPv4address>:/home/ec2-user/path/to/srcfile.txt 

逆になっただけですね。

おわりに

大事なデータを書き換えたりしないように注意しましょう。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?