Fix "bad ownership or modes for directory /etc" #3

merged
opened by kdy.ch targeting main from kdy.ch/knot-docker: fix/ssh-perms

I am not sure if you'll be fine with this kind of solution, but I couldn't push to my Knot due to permission issues. The logs would print:

Unsafe AuthorizedKeysCommand "/etc/s6-overlay/scripts/keys-wrapper": bad ownership or modes for directory /etc

Adding this chmod resolved this, and it doesn't seem to impact the container as is.

Changed files
+1
+1
Dockerfile
···
label org.opencontainers.image.licenses='MIT'
copy rootfs .
run chmod -R 755 /etc/s6-overlay
run apk add shadow s6-overlay execline openssl openssh git curl bash
run useradd -d /home/git git && openssl rand -hex 16 | passwd --stdin git
···
label org.opencontainers.image.licenses='MIT'
copy rootfs .
+
run chmod 755 /etc
run chmod -R 755 /etc/s6-overlay
run apk add shadow s6-overlay execline openssl openssh git curl bash
run useradd -d /home/git git && openssl rand -hex 16 | passwd --stdin git