userrein commited on
Commit
6be44e4
·
verified ·
1 Parent(s): 8e79286

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -0
Dockerfile ADDED
@@ -0,0 +1,31 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ubuntu:22.04
2
+
3
+ ENV DEBIAN_FRONTEND=noninteractive
4
+
5
+ RUN apt-get update && apt-get install -y \
6
+ openssh-server curl wget unzip python3 \
7
+ && rm -rf /var/lib/apt/lists/*
8
+
9
+ # setup SSH
10
+ RUN mkdir /var/run/sshd
11
+ RUN echo "root:123456" | chpasswd
12
+ RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
13
+ RUN sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config
14
+
15
+ # install ngrok
16
+ RUN curl -L https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.zip -o ngrok.zip \
17
+ && unzip ngrok.zip \
18
+ && mv ngrok /usr/local/bin/ngrok
19
+
20
+ # token kamu (ganti kalau perlu)
21
+ RUN ngrok config add-authtoken 3BUzxPBLKCbyYCQluIjmxYZCNKP_81Vwt3PwtJQMuegkJCUe
22
+
23
+ # buat halaman web biar tidak kosong
24
+ RUN echo "<h1>SSH SERVER RUNNING ✅</h1>" > index.html
25
+
26
+ EXPOSE 7860
27
+
28
+ CMD bash -c "\
29
+ python3 -m http.server 7860 & \
30
+ /usr/sbin/sshd & \
31
+ sleep 5 && ngrok tcp 22"