1. WSL安装webmin
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.920.tar.gz
tar -vxf ./webmin-1.920.tar.gz
cd webmin-1.920/
sudo ./setup.sh
运行结果如下
***********************************************************************
* Welcome to the Webmin setup script, version 1.920 *
***********************************************************************
Webmin is a web-based interface that allows Unix-like operating
systems and common Unix services to be easily administered.
Installing Webmin in /home/****/download/webmin-1.920 ...
***********************************************************************
Webmin uses separate directories for configuration files and log files.
Unless you want to run multiple versions of Webmin at the same time
you can just accept the defaults.
Config file directory [/etc/webmin]:
Log file directory [/var/webmin]:
***********************************************************************
Webmin is written entirely in Perl. Please enter the full path to the
Perl 5 interpreter on your system.
Full path to perl (default /usr/bin/perl):
Testing Perl ...
Perl seems to be installed ok
***********************************************************************
Operating system name: Ubuntu Linux
Operating system version: 18.04.6
***********************************************************************
Webmin uses its own password protected web server to provide access
to the administration programs. The setup script needs to know :
- What port to run the web server on. There must not be another
web server already using this port.
- The login name required to access the web server.
- The password required to access the web server.
- If the webserver should use SSL (if your system supports it).
- Whether to start webmin at boot time.
Web server port (default 10000):
Login name (default admin):
Login password:
Password again:
The Perl SSLeay library is not installed. SSL not available.
Webmin does not support being started at boot time on your system.
***********************************************************************
Creating web server config files..
..done
Creating access control file..
..done
Inserting path to perl into scripts..
..done
Creating start and stop scripts..
..done
Copying config files..
..done
Creating uninstall script /etc/webmin/uninstall.sh ..
..done
Changing ownership and permissions ..
..done
Running postinstall scripts ..
..done
Enabling background status collection ..
..done
Attempting to start Webmin mini web server..
Starting Webmin server in /home/geralt/download/webmin-1.920
..done
***********************************************************************
Webmin has been installed and started successfully. Use your web
browser to go to
http:/**************:10000/
and login with the name and password you entered previously.
其默认端口为10000
2. 修改防火墙设置
WSL的防火墙可能会默认限制所有端口访问,所以如果无法在本地浏览器打开webmin界面。
设置10000端口可永久访问
sudo firewall-cmd --permanent --add-port=10000/tcp
重新加载防火墙
sudo firewall-cmd --reload
3. webmin的启动、停止、重启
sudo /etc/webmin/restart
sudo /etc/webmin/stop
sudo /etc/webmin/start
4. webmin的基本使用
4.1 登录
使用wsl的IP:10000在浏览器中加载出如下界面
使用安装过程设置的用户名和密码登录
4.2 修改语言
4.3 查看登录用户
在系统下的Users and Groups中点击最下方的当前登录用户便可查看到使用各种方式登录系统的用户