File size: 1,000 Bytes
73cf777 | 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 | import os
import time
# Install SSH server
os.system("apt update && apt install -y openssh-server unzip")
# Set password root
os.system("echo 'root:123456' | chpasswd")
# Izinkan login root via password
os.system("sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config")
os.system("sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config")
# Start SSH
os.system("service ssh start")
# Download & install ngrok
os.system("wget -O ngrok.zip https://bin.equinox.io/c/bNyj1mQVY4c/ngrok-v3-stable-linux-amd64.zip")
os.system("unzip ngrok.zip")
os.system("chmod +x ngrok")
# Masukkan auth token ngrok (WAJIB)
NGROK_TOKEN = "3C0LPg1zjf8Ui52LQnfPnD8RYAp_Y8Ps2ghwf2yCNvhL7vit"
os.system(f"./ngrok config add-authtoken {NGROK_TOKEN}")
# Jalankan tunnel TCP ke port 22 (SSH)
os.system("./ngrok tcp 22 &")
print("Tunggu 10 detik untuk link SSH...")
time.sleep(10)
# Ambil info tunnel
os.system("curl -s http://127.0.0.1:4040/api/tunnels") |