Help us understand the problem. What is going on with this article?

ssh設定メモ:鍵ファイルのパーミッション

More than 5 years have passed since last update.

望ましい設定

.ssh : 700
.ssh/id_rsa : 600

james$ chown 700 .ssh
james$ chown 600 .ssh/id_rsa
james$ ls -al .ssh
drwx------   6 james staff   204  5 12 17:50 .
-rw-r--r--   1 james staff   278  5 12 17:44 config
-rw-------   1 james staff  1676  5 12 17:46 id_rsa
-rw-r--r--   1 james staff   448  5 12 17:48 known_hosts

環境

Mac OSX Yosemite

いきさつ

Windowsで使っていたキーとconfigをコピーして使おうとしたらエラーが出て、git cloneが失敗。。。

$ git clone ssh://git@example.com/var/git/hello/helloworld.git
Cloning into 'helloworld'...
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/james/.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: /Users/james/.ssh/id_rsa
Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

鍵ファイルのパーミッションが緩すぎるらしいです。
しっかりしてますね。

ソース:Permissions on private key in .ssh folder?

もっとちゃんとしたソースが欲しかったけど面倒臭かった。すみません。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした