4

Key file permissions are not correct, should be 600 or 660 instead of 644 How can I solve this?

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
Luska Zimmermann
  • 97
  • 1
  • 1
  • 8

4 Answers4

9

As @avigil and @IliaRostovtsev mentioned on their answers. You have to change the file permisions to 600 or 660 with this instruction:

chmod 600 /filepath

or

chmod 660 /filepath

Why 600 or 660 instead of 644 permissions? Becase:

644 permission means: I (owner) can change it, everyone else can read it.

600 permission means: I (owner) can write and read the file, everyone else can't.

660 permission means: I (owner) can write and read the file. Group members can write and read the file. Everyone else not mentioned above can't.

600 and 660 permissions will add an extra level of security to your files because you won't let "everyone" to read or write on your files

If you have Windows and have trouble with laravel you can check these 2 links which fix this problem:

Passport Laravel

Passport Laravel 2

Art_Code
  • 518
  • 4
  • 12
2

Setting needed permissions by running in the console on the required file:

chmod 600 /path/to/the/file
Ilia Ross
  • 13,086
  • 11
  • 53
  • 88
1

Set proper permissions with chmod 600 /path/to/your/keyfile

avigil
  • 2,218
  • 11
  • 18
0

You should be able to just do: sudo chmod 660 filename

Alex Dovzhanyn
  • 1,028
  • 6
  • 14
  • if permissions are 644 and he is owner the `sudo` should not be necessary – avigil Feb 11 '18 at 16:59
  • Never hurts to use sudo when running a chmod, that way you ensure that whoever reads the answer doesn't get yet another error regarding permissions – Alex Dovzhanyn Feb 11 '18 at 17:03
  • 1
    Probably safer to `sudo chown $(whoami) filename` first in that case, since `sudo chmod 660` on a file not owned by the current user will still cause permissions issues later – avigil Feb 11 '18 at 17:07
  • Fair enough, that would probably be the safest way – Alex Dovzhanyn Feb 11 '18 at 17:21