File tree Expand file tree Collapse file tree 2 files changed +8
-6
lines changed
Expand file tree Collapse file tree 2 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -2,4 +2,4 @@ apiVersion: v1
22appVersion : 0.4.1
33description : A Helm chart for k8s bastion
44name : k8s-ssh-bastion
5- version : 0.5.1
5+ version : 0.5.2
Original file line number Diff line number Diff line change @@ -32,11 +32,13 @@ spec:
3232
3333 USER_UID=1000
3434 for i in /etc/users/*; do
35- useradd -rm -d /home/${i##*/} -s /bin/bash -g root -u $((USER_UID++)) ${i##*/}
36- mkdir -p /home/${i##*/}/.ssh
37- install -Dm0600 $i /home/${i##*/}/.ssh/authorized_keys
38- chmod 700 /home/${i##*/}/.ssh
39- chown -R ${i##*/}:nogroup /home/${i##*/}
35+ if [ -f "$i" ]; then
36+ useradd -rm -d /home/${i##*/} -s /bin/bash -g root -u $((USER_UID++)) ${i##*/}
37+ mkdir -p /home/${i##*/}/.ssh
38+ install -Dm0600 $i /home/${i##*/}/.ssh/authorized_keys
39+ chmod 700 /home/${i##*/}/.ssh
40+ chown -R ${i##*/}:nogroup /home/${i##*/}
41+ fi
4042 done
4143
4244 mkdir -p /run/sshd
You can’t perform that action at this time.
0 commit comments