migrated ssh to centos
This commit is contained in:
@@ -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 /
|
||||
|
||||
@@ -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 "$@"
|
||||
|
||||
Reference in New Issue
Block a user