enable ssh for Azure
This commit is contained in:
12
Dockerfile
12
Dockerfile
@ -5,15 +5,25 @@ ARG APP_DIR="/opt/app"
|
||||
RUN \
|
||||
apt update && \
|
||||
apt install -y cron && \
|
||||
apt install -y openssh-server && \
|
||||
mkdir -p ${APP_DIR} && \
|
||||
useradd -d ${APP_DIR} -u 1000 user
|
||||
|
||||
COPY crontab /etc/
|
||||
COPY testscript.sh ${APP_DIR}/
|
||||
COPY sshd_config /etc/ssh
|
||||
|
||||
RUN \
|
||||
mkdir -p /var/run/sshd && \
|
||||
/usr/bin/ssh-keygen -A
|
||||
|
||||
EXPOSE 2222
|
||||
|
||||
|
||||
# USER 1000:1000
|
||||
WORKDIR ${APP_DIR}
|
||||
|
||||
CMD [ "/usr/sbin/cron", "-f" ]
|
||||
CMD [ "/opt/app/start.sh" ]
|
||||
# CMD [ "/usr/sbin/cron", "-f" ]
|
||||
|
||||
|
||||
|
12
sshd_config
Normal file
12
sshd_config
Normal file
@ -0,0 +1,12 @@
|
||||
Port 2222
|
||||
ListenAddress 0.0.0.0
|
||||
LoginGraceTime 180
|
||||
X11Forwarding yes
|
||||
Ciphers aes128-cbc,3des-cbc,aes256-cbc,aes128-ctr,aes192-ctr,aes256-ctr
|
||||
MACs hmac-sha1,hmac-sha1-96
|
||||
StrictModes yes
|
||||
SyslogFacility DAEMON
|
||||
PasswordAuthentication yes
|
||||
PermitEmptyPasswords no
|
||||
PermitRootLogin yes
|
||||
Subsystem sftp internal-sftp
|
Reference in New Issue
Block a user