Skip to content

Commit

Permalink
added ssh server
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Oct 29, 2023
1 parent 27fc41a commit 6a3fff0
Show file tree
Hide file tree
Showing 3 changed files with 98 additions and 0 deletions.
22 changes: 22 additions & 0 deletions ssh-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
10 changes: 10 additions & 0 deletions ssh-server/ssh-start
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

set -e

if [ "$1" = 'ssh-server' ]
then
exec /usr/sbin/sshd -D
fi

exec "$@"
66 changes: 66 additions & 0 deletions ssh-server/sshd_config
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 6a3fff0

Please sign in to comment.