diff --git a/Dockerfile b/Dockerfile index ecba49c..751582b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,7 +14,9 @@ RUN apk update && apk upgrade && apk add --no-cache \ nano \ tmux \ openssh-server \ - iproute2 + iproute2 \ + shadow \ + procps # Download ttyd RUN wget -O /usr/local/bin/ttyd https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 && chmod +x /usr/local/bin/ttyd diff --git a/service.ssh.sh b/service.ssh.sh index ba68194..9df76f8 100644 --- a/service.ssh.sh +++ b/service.ssh.sh @@ -12,6 +12,20 @@ X11Forwarding no Subsystem sftp internal-sftp" > /etc/ssh/sshd_config fi +if [ -z "$SET_SHELL" ]; then + SET_SHELL="/bin/bash" +fi + +if [ "$SET_SHELL" = "zsh" ]; then + SET_SHELL="/bin/zsh" +fi + +if [ "$SET_SHELL" = "fish" ]; then + SET_SHELL="/usr/bin/fish" +fi + +chsh -s $SET_SHELL + # Cloud image generates this file which prevents sshd from accepting passwords rm -f /etc/ssh/sshd_config.d/50-cloud-init.conf