LoginSignup
4
3

More than 5 years have passed since last update.

Google Compute Engineでftp

Last updated at Posted at 2015-04-23

VMインスタンスにローカルからファイルを送りたいとき ftp や sftp が使えない。
Google Cloud SDKをインストールして、gcloud compute の copy-files を使う
SDKのインストールは下記を参考に
・Google Compute Engine 入門 - Qiita
 http://qiita.com/yuko/items/460ac35d8706e8df1290

putしたいとき
gcloud compute copy-files (転送したいファイル名) (インスタンス名):(転送先での保存名) --zone (ゾーン名)
getしたいとき
gcloud compute copy-files (インスタンス名):(取得ファイル名) (ローカルの保存名) --zone (ゾーン名)

gcloud compute は、事前にsshキーが ~/.ssh/google_compute_engine に配置されていないと使えないので注意。
ここの説明がわかりやすかったので参考まで
GoogleCloudPlatform - Google Compute Engine のSSH接続 - Qiita

自分コピペ用
put
gcloud compute copy-files patch.tar instance-2:~/patch.tar --zone asia-east1-a
get
gcloud compute copy-files instance-2:~/system.log ./system.log --zone asia-east1-a

4
3
1

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
4
3