d-goo supercelldinger

コンピュータ、サーバー関係のいろんな覚え書き それと雑談

sshでキーでエラーがでた場合の対処

MacBook-Pro:~ ore$ ssh svuser@xx.xxx.xx.xxx -i /Users/ore/.ssh/id_rsa
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@         WARNING: UNPROTECTED PRIVATE KEY FILE!          @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0544 for '/Users/ore/.ssh/id_rsa' are too open.
It is recommended that your private key files are NOT accessible by others.
This private key will be ignored.
bad permissions: ignore key: /Users/ore/.ssh/id_rsa
Permission denied (publickey,gssapi-with-mic).

id_rsaファイルがtoo openらしいので(^ ^;)

キーの保存されているフォルダ.sshへ移動

MacBook-Pro:~ ore$ cd /Users/ore/.ssh/

使用しているキーのパーミッションを600に変更する。
MacBook-Pro:.ssh ore$ chmod 0600 id_rsa

再度sshでサーバー接続

MacBook-Pro:~ ore$ ssh svuser@xx.xxx.xx.xxx -i /Users/ore/.ssh/id_rsa