Skip to content

Commit 97adab7

Browse files
akarivOriHoch
authored andcommitted
Set proper permissions to directories holding authorized_keys (#10)
* Set proper permissions to directories holding authorized_keys * More permission fixes and install sftp server
1 parent ac832c9 commit 97adab7

3 files changed

Lines changed: 4 additions & 3 deletions

File tree

cca-operator/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN while ! ( apk update && apk add --no-cache bash python grep jq python3 libcu
99
RUN curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh &&\
1010
chmod 700 get_helm.sh && ./get_helm.sh --version v2.11.0 && helm version --client && rm ./get_helm.sh
1111

12-
RUN apk update && apk add openssh-server &&\
12+
RUN apk update && apk add openssh-server openssh-sftp-server &&\
1313
ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key -N "" &&\
1414
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key -N "" &&\
1515
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N "" &&\

cca-operator/add-server-authorized-key.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[ "${1}" == "--help" ] && echo cat ~/.ssh/id_rsa.pub '|' ./add-server-authorized-key.sh && exit 0
44

55
mkdir -p /root/.ssh &&\
6-
mkdir -p /etc/ckan-cloud/cca-operator &&\
6+
mkdir -p /etc/ckan-cloud/cca-operator && chmod 700 /etc/ckan-cloud && chmod 700 /etc/ckan-cloud/cca-operator && \
77
cat >> /etc/ckan-cloud/cca-operator/sshd_authorized_keys
88
[ "$?" != "0" ] && exit 1
99

cca-operator/server.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ if ! [ -e /etc/ckan-cloud/cca-operator/sshd_authorized_keys ]; then
99
fi
1010

1111
mkdir -p /root/.ssh &&\
12-
ln -s /etc/ckan-cloud/cca-operator/sshd_authorized_keys /root/.ssh/authorized_keys &&\
12+
cp /etc/ckan-cloud/cca-operator/sshd_authorized_keys /root/.ssh/authorized_keys &&\
13+
chmod 600 /root/.ssh/authorized_keys &&\
1314
echo '#!/usr/bin/env bash
1415
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
1516
cd /cca-operator

0 commit comments

Comments
 (0)