diff --git a/ssh-server/Dockerfile b/ssh-server/Dockerfile new file mode 100644 index 0000000..640a0a6 --- /dev/null +++ b/ssh-server/Dockerfile @@ -0,0 +1,22 @@ +# Largely borrowed from https://github.com/corbinu/ssh-server + +FROM quay.io/osmirnov/radiopadre:1.2.2 + +RUN apt-get update && apt-get install -y --no-install-recommends \ + openssh-server \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* + +RUN mkdir -p /var/run/sshd \ + && mkdir /root/.ssh \ + && chmod 700 /root/.ssh \ + && touch /root/.ssh/authorized_keys + +COPY sshd_config /etc/ssh/sshd_config + +EXPOSE 22 + +# RUN ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key +RUN chmod 600 /etc/ssh/ssh_host_rsa_key + +ENTRYPOINT ["/usr/sbin/sshd", "-D"] diff --git a/ssh-server/ssh-start b/ssh-server/ssh-start new file mode 100755 index 0000000..b2ab6a1 --- /dev/null +++ b/ssh-server/ssh-start @@ -0,0 +1,10 @@ +#!/bin/bash + +set -e + +if [ "$1" = 'ssh-server' ] +then + exec /usr/sbin/sshd -D +fi + +exec "$@" diff --git a/ssh-server/sshd_config b/ssh-server/sshd_config new file mode 100644 index 0000000..736a067 --- /dev/null +++ b/ssh-server/sshd_config @@ -0,0 +1,66 @@ +# Logging +SyslogFacility AUTH +LogLevel INFO + +# Authentication: +LoginGraceTime 120 +PermitRootLogin without-password +StrictModes yes + +PubkeyAuthentication yes +#AuthorizedKeysFile %h/.ssh/authorized_keys + +HostKey /etc/ssh/ssh_host_rsa_key + +# Don't read the user's ~/.rhosts and ~/.shosts files +IgnoreRhosts yes +# similar for protocol version 2 +HostbasedAuthentication no +# Uncomment if you don't trust ~/.ssh/known_hosts for RhostsRSAAuthentication +#IgnoreUserKnownHosts yes + +# To enable empty passwords, change to yes (NOT RECOMMENDED) +PermitEmptyPasswords no + +# Change to yes to enable challenge-response passwords (beware issues with +# some PAM modules and threads) +ChallengeResponseAuthentication no + +# Change to no to disable tunnelled clear text passwords +PasswordAuthentication no + +# Kerberos options +#KerberosAuthentication no +#KerberosGetAFSToken no +#KerberosOrLocalPasswd yes +#KerberosTicketCleanup yes + +# GSSAPI options +#GSSAPIAuthentication no +#GSSAPICleanupCredentials yes + +X11Forwarding yes +X11DisplayOffset 10 +PrintMotd no +PrintLastLog yes +TCPKeepAlive yes +#UseLogin no + +#MaxStartups 10:30:60 +#Banner /etc/issue.net + +# Allow client to pass locale environment variables +AcceptEnv LANG LC_* + +Subsystem sftp /usr/lib/openssh/sftp-server + +# Set this to 'yes' to enable PAM authentication, account processing, +# and session processing. If this is enabled, PAM authentication will +# be allowed through the ChallengeResponseAuthentication and +# PasswordAuthentication. Depending on your PAM configuration, +# PAM authentication via ChallengeResponseAuthentication may bypass +# the setting of "PermitRootLogin without-password". +# If you just want the PAM account and session checks to run without +# PAM authentication, then enable this but set PasswordAuthentication +# and ChallengeResponseAuthentication to 'no'. +UsePAM yes