LightsailへのSSH通信が弾かれる場合のメモ

LightsailからSSHキーをダウンロードして、SSH接続しようとしたら怒られたのでメモ。

エラー内容↓

$ ssh -i ssh-key.pem bitmani@<IPaddress>

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for 'ssh-key.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 "ssh-key.pem": bad permissions

ざっくり訳すと
「ssh-key.pemの権限がオープンすぎ。他の人から読めないようにしないとダメよ」
とのこと。
ということで、$ chmod 700 ssh-key.pem としてやることで解決しました。

Linux ip-xxx-xxx-xxx-xxx 4.19.0-14-cloud-amd64 #1 SMP Debian 4.19.171-2 (2021-01-30) x86_64

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
       ___ _ _                   _
      | _ |_) |_ _ _  __ _ _ __ (_)
      | _ \ |  _| ' \/ _` | '  \| |
      |___/_|\__|_|_|\__,_|_|_|_|_|
  
  *** Welcome to the Bitnami WordPress 5.6.1-1                     ***
  *** Documentation:  https://docs.bitnami.com/aws/apps/wordpress/ ***
  ***                 https://docs.bitnami.com/aws/                ***
  *** Bitnami Forums: https://community.bitnami.com/               ***

#######################################################
###    For frequently used commands, please run:    ###
###         sudo /opt/bitnami/bnhelper-tool         ###
#######################################################

Last login: Wed May 26 02:12:02 2021 from 54.240.200.70
bitnami@ip-xxx-xxx-xxx-xxx:~$ exit
タイトルとURLをコピーしました