Browse Source

fix permissions for authorized_keys

master
aligator 1 year ago
parent
commit
38a178fd7b
1 changed files with 4 additions and 1 deletions
  1. 4
    1
      Dockerfile

+ 4
- 1
Dockerfile View File

@@ -17,13 +17,16 @@ RUN apk add --no-cache --update-cache openssh && \
17 17
     echo "$SSH_USER:" | chpasswd && \
18 18
     chown root /home/$SSH_USER && \
19 19
     mkdir -p /home/$SSH_USER/data && \
20
-    chown $SSH_USER:$SSH_USER /home/$SSH_USER/data
20
+    chown $SSH_USER:$SSH_USER /home/$SSH_USER/data 
21 21
 
22 22
 COPY sshd_config /etc/ssh/sshd_config
23 23
 COPY authorized_keys /etc/ssh/authorized_keys/${user}
24 24
 COPY ssh_host_ed25519_key /etc/ssh/ssh_host_ed25519_key
25 25
 COPY ssh_host_rsa_key /etc/ssh/ssh_host_rsa_key
26 26
 
27
+RUN chmod 600 /etc/ssh/authorized_keys/$SSH_USER && \
28
+    chown $SSH_USER:$SSH_USER /etc/ssh/authorized_keys/$SSH_USER
29
+
27 30
 EXPOSE 22
28 31
 
29 32
 CMD ["/usr/sbin/sshd", "-D"]

Loading…
Cancel
Save