File tree 3 files changed +22
-4
lines changed
3 files changed +22
-4
lines changed Original file line number Diff line number Diff line change @@ -22,15 +22,23 @@ RUN apt-get install -y \
22
22
sudo \
23
23
wget \
24
24
xorgxrdp \
25
- xrdp && \
25
+ xrdp \
26
+ openssh-server && \
26
27
apt remove -y light-locker xscreensaver && \
27
28
apt autoremove -y && \
28
29
rm -rf /var/cache/apt /var/lib/apt/lists
29
30
31
+ # SSH setup: create host keys, allow password auth
32
+ RUN mkdir -p /var/run/sshd && \
33
+ sed -i 's/^#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config && \
34
+ sed -i 's/^#PermitRootLogin.*/PermitRootLogin no/' /etc/ssh/sshd_config && \
35
+ sed -i 's/UsePAM yes/UsePAM no/' /etc/ssh/sshd_config
36
+
37
+
30
38
COPY ubuntu-run.sh /usr/bin/
31
39
RUN mv /usr/bin/ubuntu-run.sh /usr/bin/run.sh
32
40
RUN chmod +x /usr/bin/run.sh
33
41
34
42
# Docker config
35
- EXPOSE 3389
43
+ EXPOSE 3389 22
36
44
ENTRYPOINT ["/usr/bin/run.sh" ]
Original file line number Diff line number Diff line change @@ -3,7 +3,8 @@ services:
3
3
build :
4
4
context : .
5
5
container_name : ubuntu-rdp
6
+ cap_add :
7
+ - CAP_AUDIT_WRITE
6
8
ports :
7
9
- " 3389:3389"
8
- # The CMD is in the Dockerfile, but you can override if needed:
9
- # command: ["/usr/sbin/xrdp", "--nodaemon"]
10
+ - " 2222:22"
Original file line number Diff line number Diff line change @@ -12,6 +12,12 @@ start_xrdp_services() {
12
12
xrdp-sesman && exec xrdp -n
13
13
}
14
14
15
+ start_ssh_services () {
16
+ service ssh restart
17
+ wait
18
+ }
19
+
20
+
15
21
stop_xrdp_services () {
16
22
xrdp --kill
17
23
xrdp-sesman --kill
@@ -34,6 +40,9 @@ usermod -aG sudo admin
34
40
35
41
echo -e " This script is ended\n"
36
42
43
+ echo -e " starting sshd services...\n"
44
+ start_ssh_services
45
+
37
46
echo -e " starting xrdp services...\n"
38
47
39
48
trap " stop_xrdp_services" SIGKILL SIGTERM SIGHUP SIGINT EXIT
You can’t perform that action at this time.
0 commit comments