Compare commits
3 commits
Author | SHA1 | Date | |
---|---|---|---|
cb5562272c | |||
12c970cd9f | |||
a0c265c6ca |
3 changed files with 18 additions and 0 deletions
|
@ -30,6 +30,8 @@ COPY service.ssh.sh /app/
|
||||||
COPY service.ttyd.sh /app/
|
COPY service.ttyd.sh /app/
|
||||||
RUN chmod +x /app/entrypoint.sh /app/service.ssh.sh /app/service.ttyd.sh
|
RUN chmod +x /app/entrypoint.sh /app/service.ssh.sh /app/service.ttyd.sh
|
||||||
|
|
||||||
|
COPY motd.txt /etc/motd
|
||||||
|
|
||||||
RUN mkdir -p /srv/stack
|
RUN mkdir -p /srv/stack
|
||||||
WORKDIR /srv/stack
|
WORKDIR /srv/stack
|
||||||
|
|
||||||
|
|
|
@ -22,6 +22,22 @@ if [ ! -f /etc/ssh/ssh_host_rsa_key ]; then
|
||||||
ssh-keygen -A
|
ssh-keygen -A
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -f /etc/ssh/sshd_config -a `cat /etc/ssh/sshd_config | wc -l` = 1 ]; then
|
||||||
|
echo "sshd_config is not complete, regenerating..."
|
||||||
|
rm -f /etc/ssh/sshd_config
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ ! -f /etc/ssh/sshd_config ]; then
|
||||||
|
echo "Include /etc/ssh/sshd_config.d/*.conf" > /etc/ssh/sshd_config
|
||||||
|
echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
|
||||||
|
echo "AuthorizedKeysFile .ssh/authorized_keys" >> /etc/ssh/sshd_config
|
||||||
|
echo "PasswordAuthentication yes" >> /etc/ssh/sshd_config
|
||||||
|
echo "AllowTcpForwarding no" >> /etc/ssh/sshd_config
|
||||||
|
echo "GatewayPorts no" >> /etc/ssh/sshd_config
|
||||||
|
echo "X11Forwarding no" >> /etc/ssh/sshd_config
|
||||||
|
echo "Subsystem sftp internal-sftp" >> /etc/ssh/sshd_config
|
||||||
|
fi
|
||||||
|
|
||||||
# Array to store child PIDs
|
# Array to store child PIDs
|
||||||
declare -a CHILD_PIDS=()
|
declare -a CHILD_PIDS=()
|
||||||
|
|
||||||
|
|
0
motd.txt
Normal file
0
motd.txt
Normal file
Loading…
Reference in a new issue