-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (33 loc) · 1.04 KB
/
Dockerfile
File metadata and controls
43 lines (33 loc) · 1.04 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
FROM ubuntu
# to build
# docker build -t=ssh_tmux .
# at first run:
# docker run -p 443:22 -d --name=ssh_tmux ssh_tmux
# later:
# docker start ssh_tmux
# to attach
# docker exec -it ssh_tmux /bin/bash
# then: su student
# and start tmux if its not started already
# username : student
# password : student1
RUN apt-get update && apt-get install -y vim man tmux zsh openssh-server locales
RUN useradd -m student; \
chsh -s $(which zsh) student; \
echo "student:student1" | chpasswd
COPY .zshrc /home/student/
COPY .tmux.conf /home/student/
COPY sshd_config /etc/ssh/sshd_config
COPY authorized_keys /home/student/.ssh/
COPY locale.gen /etc/locale.gen
RUN /usr/bin/ssh-keygen -A ;\
chsh -s $(which zsh) student;\
chown student:student /home/student -R ;\
locale-gen; \
mkdir -p /var/run/sshd
RUN chown root:root /home/student/.tmux.conf; \
chown root:root /home/student/.zshrc; \
chmod 644 /home/student/.tmux.conf; \
chmod 644 /home/student/.zshrc;
EXPOSE 22
CMD ["/usr/sbin/sshd", "-D"]