0
0

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.

pm2 deploy しようとしたが、「WARNING: UNPROTECTED PRIVATE KEY FILE!」でデプロイ出来なかった。

Posted at

PM2デプロイコマンドを叩いたら、下記のようなエラーがでて、デプロイできなかった。
そうなった原因はわからない。数日前までは問題なくデプロイ出来ていたので…

$ pm2 deploy production
--> Deploying to production environment
--> on host ***********

○ deploying origin/master
○ executing pre-deploy-local
○ executing pre-deploy `git pull`
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/***/.ssh/***.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
Load key "/Users/irahara/.ssh/candeo-fm.pem": bad permissions
*********: Permission denied (publickey,gssapi-keyex,gssapi-with-mic).

pre-deploy hook failed

Deploy failed
Deploy failed with exit code: 1

対処方法としては、再度鍵に権限を付与してあげる。

$sudo chmod 0600 ***.pem

これでデプロイ出来ました。

 参考にした記事

0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?