-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
30 lines (25 loc) · 912 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM archlinux:latest
# sshd
# RUN apt update
# RUN apt install -y openssh-server vim
# # RUN mkdir /var/run/sshd
# RUN echo 'root:root' | chpasswd
# RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
# RUN service ssh start
# ENTRYPOINT service ssh start
RUN pacman -Syy
RUN pacman -S --noconfirm openssh
RUN /usr/bin/ssh-keygen -A
RUN echo 'root:root' | chpasswd
RUN sed -i -e 's/^UsePAM yes/UsePAM no/g' /etc/ssh/sshd_config
RUN echo "PermitRootLogin yes" >> /etc/ssh/sshd_config
# RUN systemctl start sshd
# RUN sed -i \
# -e 's/^#*\(PermitRootLogin\) .*/\1 yes/' \
# -e 's/^#*\(PasswordAuthentication\) .*/\1 yes/' \
# -e 's/^#*\(PermitEmptyPasswords\) .*/\1 yes/' \
# -e 's/^#*\(UsePAM\) .*/\1 no/' \
# /etc/ssh/sshd_config
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]