I created a script to change the allowed IP address from a machine with dynamic IP

The script is available here:

It is intended for users who sit behind a machine with dynamic IP, and who want to restrict user access to Webmin based on their IP, without having to rely on a DDNS service.

The script

  1. will discover your IP number against a free DNS service such as OpenDNS or Google;
  2. will connect to your remote server via SSH, retrieve the /etc/webim/miniserv.conf file Webmin uses for settings;
  3. will check whether the allow= line already contains your current IP number;
  4. If not, modify it so that the IP number is current.

Currently the script is only available in PowerShell, Bash will be provided shortly.
I am looking very much forward to any feedback you may have on this.

Also, I’d like to know from a Webmin developer if it’s necessary for the script to restart Webmin once the allow= line in miniserv.conf should change, or it’s not needed. (Currently the script does NOT restart Webmin, since the change could be quite frequent).

Bash script has been added.

working now on a change to preserve multiple unallowed IPs, while still updating the dynamic IP of the machine running the script.

Hello,

Thanks for sharing it! Hopefully, it will be useful for someone.

Thanks! What is your opinion, should Webmin be restarted after modifying the allow= line in miniserv.conf?
I’ve had mixed results in testing this, not sure what should be the policy.

Yes, you should restart Webmin afterwards by running systemctl restart webmin command.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.