-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
29 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
FROM alpine:latest | ||
|
||
RUN apk --update add --no-cache openssh bash | ||
# Comment old configs | ||
RUN sed -i 's/^PermitRootLogin.*/#PermitRootLogin yes/' /etc/ssh/sshd_config | ||
RUN sed -i 's/^AllowTcpForwarding.*/#AllowTcpForwarding yes/' /etc/ssh/sshd_config | ||
RUN sed -i 's/^PermitOpen.*/#PermitOpen any/' /etc/ssh/sshd_config | ||
RUN sed -i 's/^PermitTunnel.*/#PermitTunnel yes/' /etc/ssh/sshd_config | ||
RUN sed -i 's/^Port.*/#Port 22/g' /etc/ssh/sshd_config | ||
# New Config | ||
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config | ||
RUN echo "AllowTcpForwarding yes" >> /etc/ssh/sshd_config | ||
RUN echo "PermitOpen any" >> /etc/ssh/sshd_config | ||
RUN echo "PermitTunnel yes" >> /etc/ssh/sshd_config | ||
RUN echo "Port 22" >> /etc/ssh/sshd_config | ||
# | ||
RUN echo "root:password" | chpasswd | ||
RUN rm -rf /var/cache/apk/* | ||
RUN /usr/bin/ssh-keygen -A | ||
RUN ssh-keygen -t rsa -b 4096 -f /etc/ssh/ssh_host_key | ||
ENV NOTVISIBLE "in users profile" | ||
RUN echo "export VISIBLE=now" >> /etc/profile | ||
EXPOSE 22 | ||
CMD ["/usr/sbin/sshd", "-D"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.