💾 Archived View for rkta.srht.site › jekyll-perms.gmi captured on 2023-11-14 at 07:48:52. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-09-08)

➡️ Next capture (2023-12-28)

-=-=-=-=-=-=-

Rene Kita's weblog

Blog[0] About[1] RSS[2] Links[3]

Wrong permissions on jekyll site files

2018-12-27

Problem

If you changed your default umask from 022 to something more strict and get Error 403 for your website after putting your _site's files via ftp:

Your file permissions are not what the need to be for your webserver.

Solution

Remove the _site directory:

	rm -r _site

Build your site with:

	(umask 022 && jekyll build)

Using jekyll serve here worked not as anticipated, so I'll stick with removing _site after using serve.

---- *Update 2019-07-29 21:41:13 +0200*

What a mess! What I said above is not always sufficient, files in pages or _includes are not affected by the jekyll build. Those files seem to be just copied with their original permissions. To find all files with wrong permissions, go to the directory you want to check and do

	find \! -perm 644 -type f -o \! -perm 755 -type d

Directories need 755 and files need 644. To automatically change permissions you need two steps:

	find \! -perm 644 -type f -exec chmod 644 {} \;
	find \! -perm 755 -type d -exec chmod 755 {} \;

E-mail: mail@rkta.de[4] IRC: #rkta[5] on Libera.Chat[6]

Copyright © 2017-2023 Rene Kita

[0] Blog

[1] About

[2] RSS

[3] Links

[4] mail@rkta.de

[5] #rkta

[6] Libera.Chat