LoginSignup
0
0

More than 1 year has passed since last update.

【Mac terminal】SSH接続でパーミッションエラーになる

Posted at

はじめに

Mac使い一日目、いつも通りAWSのインスタンスにterminalを使ってログインしようとしたらパーミッションエラーが発生する。

Warning: Permanently added '52.196.196.190' (ECDSA) to the list of known hosts.
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/yanagimorisatsuki/Documents/SAA/udemy-sample-mac.pem' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.

「パーミッションが644です!!!」
え?何が悪いん?AWSが作成してダウンロードしたペアキーですけど。

権限を600にしたら成功した

所有者以外権限つけたらダメらしい。
Windowsではこんなこと気にしたことなかったのにな。。

権限変更

chmod 600 [キーファイルのパス]

再度ログイン。

ssh ec2-user@[接続先IP] -i [鍵ファイルパス]

       __|  __|_  )
       _|  (     /   Amazon Linux 2 AMI
      ___|\___|___|

https://aws.amazon.com/amazon-linux-2/

うまくいきました。

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