If your server is connected to the Internet and you use SSH to connect to it, you can secure it by disallowing Webmin from accepting any remote connections. You can then use an SSH tunnel to connect to Webmin. This lowers the potential attack surface of your machine and protects you against possible security vulnerabilities in Webmin itself. Any attacker would have to break into your SSH account or otherwise gain local access to your system to connect to Webmin.
Before you begin, you should follow the Restricting Webmin access to a specific IP recipe of this chapter and add the IP address
127.0.0.1 to the list of hosts allowed to connect to Webmin.
In this recipe, we'll be using the command ...