From aa41ae926beba85ad2cb06e10b5f4f270309b9c4 Mon Sep 17 00:00:00 2001 From: Matthias Lucas Jaros Date: Sat, 18 Oct 2025 14:35:18 +0200 Subject: Initial commit. WIP --- Dockerfile | 6 ++++++ init | 17 +++++++++++++++++ ssh.conf | 20 ++++++++++++++++++++ 3 files changed, 43 insertions(+) create mode 100644 Dockerfile create mode 100644 init create mode 100644 ssh.conf diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..618f09f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,6 @@ +FROM alpine +RUN apk add --no-cache openssh-server fish +COPY ssh.conf /etc/ssh/sshd_config.d/ +COPY ./etc/ssh/ /etc/ssh/ +#ENTRYPOINT ["/usr/sbin/sshd", "-D", "-e"] +ENTRYPOINT ["fish"] diff --git a/init b/init new file mode 100644 index 0000000..db06b55 --- /dev/null +++ b/init @@ -0,0 +1,17 @@ +#!/usr/sbin/env fish + +argparse 'u/users+' 'r/repos+' -- $argv + +# create users and copy keys in correct location, set permissions +for user in $_flag_u + echo "Setting up user: $user" + set -l HOME="/home/$user" + adduser --home $HOME --disabled-password "$user" + mkdir "$HOME/.ssh" + cp "/srv/keys/$user" "$HOME/.ssh" + chown -R $user "$HOME" + chmod 700 "$HOME" +end + +# run ssh daemon +/usr/sbin/sshd -D -e diff --git a/ssh.conf b/ssh.conf new file mode 100644 index 0000000..bc96c2f --- /dev/null +++ b/ssh.conf @@ -0,0 +1,20 @@ +PermitRootLogin no +PasswordAuthentication no + +HostKey /etc/ssh/ssh_host_rsa_key +HostKey /etc/ssh/ssh_host_ecdsa_key +HostKey /etc/ssh/ssh_host_ed25519_key + +# Logging +SyslogFacility AUTH +LogLevel INFO + +#PermitTTY yes +#AllowAgentForwarding yes + +# Example of overriding settings on a per-user basis +#Match User anoncvs +# X11Forwarding no +# AllowTcpForwarding no +# PermitTTY no +# ForceCommand cvs server -- cgit v1.3.1