diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 30823fe..51605ec 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -34,7 +34,7 @@ jobs: - name: setup sshd server run: | - apk add git make curl perl bash build-base zlib-dev ucl-dev + apk add git make curl perl bash build-base zlib-dev ucl-dev sudo make ssh-server - name: testing diff --git a/Makefile b/Makefile index ce632e1..d8878db 100644 --- a/Makefile +++ b/Makefile @@ -104,6 +104,15 @@ ssh-server: cat tests/.ssh/test.pub >> /home/drone-scp/.ssh/authorized_keys chmod 600 /home/drone-scp/.ssh/authorized_keys chown -R drone-scp /home/drone-scp/.ssh + # add public key to root user + mkdir -p /root/.ssh + chmod 700 /root/.ssh + cat tests/.ssh/id_rsa.pub >> /root/.ssh/authorized_keys + cat tests/.ssh/test.pub >> /root/.ssh/authorized_keys + chmod 600 /root/.ssh/authorized_keys + # Append the following entry to run ALL command without a password for a user named drone-scp: + cat tests/sudoers >> /etc/sudoers.d/sudoers + # install ssh and start server apk add --update openssh openrc rm -rf /etc/ssh/ssh_host_rsa_key /etc/ssh/ssh_host_dsa_key sed -i 's/^#PubkeyAuthentication yes/PubkeyAuthentication yes/g' /etc/ssh/sshd_config