LoginSignup
1

More than 1 year has passed since last update.

SSH接続(ターミナル)

Last updated at Posted at 2022-04-10

SSH接続

ssh -i <秘密鍵のパス> ユーザー@アドレス

例)
ssh -i /Users/hoge/〇〇.pem user@localhost

pemファイルの権限

pemファイルの閲覧権限を変更していないとセキュリティが低いと、SSH接続をした際にエラーが出る

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/hoge/〇〇.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/hoge/〇〇.pem": bad permissions
bitnami@52.199.244.147: Permission denied (publickey).

これが出たらこの記事が参考になった。
ファイルのパーミッション設定

対象のファイル(今回はpemファイル)の権限をターミナルで変更する。

chmod 600 Users/hoge/〇〇.pem

これで再度SSH接続すると接続できた。

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
1