migrated ssh to centos

This commit is contained in:
2021-01-24 05:17:25 +01:00
parent 330180d1a3
commit 0bd436b10c
2 changed files with 8 additions and 6 deletions

View File

@@ -1,5 +1,5 @@
FROM ubuntu
RUN apt-get update && apt-get install -y openssh-server rsync
FROM centos:7
RUN yum update -y && yum install -y openssh-server openssh-clients rsync
RUN mkdir /var/run/sshd
COPY sshd_config /etc/ssh/sshd_config
COPY docker-entrypoint.sh /

View File

@@ -1,8 +1,4 @@
#!/bin/bash
cleanup() {
exit
}
trap cleanup HUP INT QUIT TERM
if [[ (! -z "${ADDITIONAL_USER}" ) && ( "${ADDITIONAL_USER}" != "root" ) ]]; then
@@ -50,6 +46,12 @@ else
fi
fi
rm /etc/ssh/ssh_host_*key*
ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key
ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key
ssh-keygen -t ed25519 -f /etc/ssh/ssh_host_ed25519_key
usermod -s /bin/bash root
/usr/sbin/sshd -D
#exec "$@"