I always forget how i have set up my http tunnel for Webmin. I do this all five years or so. So i made finally a tutorial for it.
PDF version, 300 kb: www.reinerstilesets.de/tutorialdata/webmin%20by%20tunnel.pdf
English |
1. Set up SSH tunnel with PuTTY
- Open PuTTY → Connection → SSH → Auth → select your private key file (.ppk)
- Go to Connection → SSH → Tunnels →
- Source port:
10000
- Destination:
127.0.0.1:10000
- Type: Local
- Click Add
- Source port:
- Go back to Session → enter hostname and port (server address, port 22)
- Open connection and log in with your username (e.g.,
root
)
2. Access Webmin through the tunnel in your browser
- On your local machine’s browser, open:
https://localhost:10000
orhttp://localhost:10000
3. Verify that Webmin works through the tunnel
- Ensure you can log in and use Webmin via the tunnel before proceeding.
4. Bind Webmin to localhost only
- Edit the file
/etc/webmin/miniserv.conf
- Add or modify the line:
bind=127.0.0.1
- Restart Webmin:
sudo systemctl
restart webmin
Now Webmin is only accessible through the SSH tunnel, preventing direct external access without locking you out.
Remember that you have to start the Putty tunnel now before you call the Webmin page with localhost:10000
Deutsch |
1. SSH-Tunnel mit PuTTY einrichten
- PuTTY öffnen → Connection → SSH → Auth → deinen Private Key (.ppk) auswählen
- Gehe zu Connection → SSH → Tunnels →
- Source port:
10000
- Destination:
127.0.0.1:10000
- Typ: Local
- Klick auf Add
- Source port:
- Zurück zu Session → Hostname und Port (Serveradresse, Port 22) eingeben
- Verbindung öffnen und mit Benutzername (z.B.
root
) einloggen
2. Webmin über den Tunnel im Browser aufrufen
- Im Browser auf deinem lokalen Rechner:
https://localhost:10000
oderhttp://localhost:10000
3. Prüfen, ob Webmin über den Tunnel funktioniert
- Vergewissere dich, dass du dich einloggen und Webmin nutzen kannst, bevor du weitermachst.
4. Webmin nur auf localhost binden
- Datei
/etc/webmin/miniserv.conf
bearbeiten - Zeile hinzufügen oder ändern:
bind=127.0.0.1
- Webmin neu starten:
sudo systemctl
restart webmin
Damit ist Webmin jetzt nur noch über den SSH-Tunnel erreichbar, und direkte Zugriffe von außen werden verhindert.
Denke daran dass du jetzt jedesmal erst den Putty Tunnel starten musst bevor du Webmin über http: //localhost:10000 aufrufst
Images / Bilder |
Sessions. Add a new connection, add the needed details.
Sessions. Mach eine neue Connection, und trage deine Daten hier ein.
Set up the tunnel. Type in values, click at Add. 10000 , localhost:10000
Tunnel einrichten. Zahlen eingeben, auf Add klicken.
I have set up my server so that it only accepts ssh connections. No password means nobody can brute force it. So i needed to add my Private SSH key.
Ich habe meinen Server so eingerichtet dass ich nur über SSH einloggen kann. Kein Passwort bedeutet es kann niemand brute forcen. Also muss ich hier meinen Private SSH Key auswählen.
I love auto login. So let’s add the autologin name. Yes, i use root. Since usually i have administrative things to do when i log in.
Ich liebe Autologin. Also fügen wir den Autlogin Usernamen hier ein. Ja, ich nutze Root, denn normalerweise habe ich tatsächlich adminstrative Tätigkeiten wenn ich mich auf meinem Server einlogge.
Don’t forget to save the settings. We don’t want to repeat the setup with every connection.
Vergesst nicht zu speichern. Wir wollen das Setup nicht jedesmal wiederholen.
Now test if everything works. You should be able to call Webmin in your browser by localhost:10000 or https: //localhost:10000
Jetzt testet ob alles funktioniert. Webmin sollte sich nun mit geöffnetem Tunnel über localhost:10000 oder https: //localhost:10000 im Browser aufrufen lassen.
Restart Webmin in the console:
sudo systemctl restart webmin
And now Webmin is not longer to reach from outside of the tunnel. And nobody except you knows that Webmin even exists at this server.
Und somit ist Webmin von ausserhalb des Tunnels nicht mehr länger erreichbar. Und niemand ausser dir weiss nun dass Webmin überhaupt auf deinem Server läuft.
26.07.2025
Reiner