LoginSignup
0
1

More than 3 years have passed since last update.

WARNING: UNPROTECTED PRIVATE KEY FILE! というエラーが出たらやること

Last updated at Posted at 2020-03-27

秘密鍵(id_rsa)について、よくつまづくのでメモ。

はじめに

自分の秘密鍵を.ssh配下にコピペしてSSHでのgit cloneしたら以下のエラーが。

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/home/yu_uchida/.ssh/id_rsa' are too open.
It is required that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /home/yu_uchida/.ssh/id_rsa
Permission denied (publickey).
fatal: Could not read from remote repository.

パーミッションが too openだと怒られてます。

解決方法

chmodでパーミッションを0600にする。

$ chmod 0600 id_rsa

これでgit cloneできるようになりました。

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