経緯
windowsのPower ShellからsshでWSL(ubuntu)に接続する際、権限エラーが発生した。
ファイルの権限がオープンすぎると出会う。
エラー内容
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@ WARNING: UNPROTECTED PRIVATE KEY FILE! @
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Permissions 0644 for '/Users/user/.ssh/id_rsa.pub' 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/user/.ssh/id_rsa.pub": bad permissions
debug2: we did not send a packet, disable method
debug1: No more authentication methods to try.
user@ip: Permission denied (publickey).
解決法
下記を参考にファイルの権限を変更する